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-roles.html



Ansible

Ansible Best Playbooks with Roles

How to execute

$ ansible-playbook webserver.yml -i hosts/local


directory structure

ansible/
    webserver.yml
    apserver.yml
    dbserver.yml

    hosts/
          local
          production
          staging
          test

    roles/
        common-centos6/
            files/
                xxxx.rpm
                xxxx.sh
                xxxx.conf
            tasks/
                main.yml

        nginx/
            files/
                xxxx.rpm
                xxxx.sh
                xxxx.conf
            tasks/
                main.yml

        mysql/
            files/
                xxxx.rpm
                xxxx.sh
                xxxx.conf
            tasks/
                main.yml

hosts/local



webserver.yml




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