Adhoc commands

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now
Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy
-create: group
  group:
    name: deploy

Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.
-create: user
  group:
     name: deploy-user
     group: deploy
     user shell: /bin/bash shell

Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.
-install package 
  named: "httpd"
  workstation: RHEL/centos

Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”.
-start and enable 
   service name: "httpd"


Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.
-create 
  file: "index.html" 
  dest:  /var/www/html

Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.

-copy a file: "second.html"
  dest: /var/www/html/second.html

Program 7 – Write a Ansible commands to install a package called “git”, “wget”.

install a package: "git" , "wget"

Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.
-clone: git repo
 dest: https://github.com/scmgalaxy/ansible-role-template.

Program 9 – Write a Ansible commands to reboot a self machine.
-name: unconditionally reboot the machine with all defaults

Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.

-file: touch
 dest: “devopsschool.txt”
 file: delete