cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

middleware:iac:ansible:best-with-oneymlfile.html



Ansible Best Playbooks with one yml file

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




middleware/iac/ansible/best-with-oneymlfile.html.txt ยท Last modified: 2020/04/12 by admin

Page Tools