Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy"
ansible localhost -m group -a "name=Deploy state=present"
program 2 - Write a Ansible Adhoc Commands to create a group called “deploy
ansible localhost -m user -a "name=deploy-user group=deploy shell=/bin/bash state=present"
Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.
ansible localhost -m file -a "path= /var/www/html/index.html state=touch mode=0644"
ansible localhost -m lineinfile -a "path=/var/www/html/index.html line='
My Web PageHello, this is my web page.
'"Program 7 – Write a Ansible commands to install a package called “git”, “wget”.
ansible localhost -m yum -a "name=git,wget state=present"
Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.
ansible localhost -m git -a "repo=https://github.com/scmgalaxy/ansible-role-template dest=/path/to/destination"
Top comments (0)