cmdref.net - Cheat Sheet and Example

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

User Tools

Site Tools


Sidebar








Etc


Reference














.

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



Ansible

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

127.0.0.1

test.yml




middleware/iac/ansible/best-with-oneymlfile.html.txt ยท Last modified: 2017/09/13 by admin