Debug School

sumanth.myneni@gmail.com
sumanth.myneni@gmail.com

Posted on

Ansible-Ad-Hoc

These are ad-hoc commands.

Create Group

ansible localhost -m group -a "name=Sumanth-A1"

Enter fullscreen mode Exit fullscreen mode

Create User

ansible localhost -m user -a "name=deploy-user state=present"
Enter fullscreen mode Exit fullscreen mode

Install httpd package

ansible localhost -m package -a "name=httpd state=present"
Enter fullscreen mode Exit fullscreen mode

Start httpd and enable

ansible localhost -m systemd -a "name=httpd state=started enabled=yes"

Enter fullscreen mode Exit fullscreen mode

Move index.html file

ansible localhost -m copy -a "src=/usr/local/bin dest=/var/www/html/index.html mod=0644"
Enter fullscreen mode Exit fullscreen mode

Install package "git"

ansible localhost -m package -a "name=git state=present"
Enter fullscreen mode Exit fullscreen mode

Install package "wget"

ansible localhost -m package -a "name=wget state=present"
Enter fullscreen mode Exit fullscreen mode

Clone GIT Repo

ansible localhost -m git -a "repo=https://github.com/scmgalaxy/repo.git dest=/home/user/repo"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)