Table of Contents

Ansible Best Playbooks with one yml file



Ansible CLI Commands Cheet Sheat and Configuration Examples


How to execute Playbook

# ansible-playbook -i hosts_test  centos6.yml  --list-tasks
# ansible-playbook -i hosts_test  centos6.yml  --check --diff   #Dry Run
# ansible-playbook -i hosts_test  sec-web.yml
# ansible-playbook -i hosts_test  fx-web.yml
# ansible-playbook -i hosts_test  test.yml


Directory Structure

/home/ansible
     hosts
     hosts_test
     hosts_user01

     test.yml
     centos7.yml
     ubuntu16.yml
     sec-web.yml
     sec-ap.yml
     sec-db.yml
     fx-web.yml
     fx-ap.yml
     fx-db.yml

    files/
        xxxx.rpm
        xxxx.sh
        xxxx.conf

hosts_test

192.168.0.11   #test-server-1
192.168.0.12   #test-server-2
192.168.0.13   #test-server-3
192.168.0.14   #test-server-4
192.168.0.15   #test-server-5

test.yml

-hosts:all
  tasks:


Ansible CLI Commands Cheet Sheat and Configuration Examples





Ansible CLI Commands Cheet Sheat and Configuration Examples