with tags Implement test recipe
on each role Procedure for Provisioning • Server creation • Via terraform & add tags • Provisioning & deploy • Using dynamic inventory • Implement test recipe • Using Ruby AWS SDK • Name:pairs-jp-web-xx • env:prod • regin:jp • role:web exists
servers Provisioning and
deploy current app version cd /path/to/ansible_dir
ansible-playbook -i hosts/pairs/prod/jp
playbook playbook/web.yml # Example ) playbook for web server
# Dynamic inventory Script : hosts/pairs/prod/jp/ec2.py
# Var file : hosts/pairs/prod/jp/group_vars/all.yml
--- # For web-server # Usage # ansible-playbook -i hosts/pairs/prod/jp playbook/web.yml - hosts: web gather_facts: yes vars_files: - "{{ inventory_dir }}/group_vars/secret.yml" roles: - { role: common, tags: common } - { role: mysql_client, tags: mysql_client } - { role: nginx, tags: nginx } - { role: mackerel, tags: mackerel } - { role: circus, tags: circus } - { role: td-agent, tags: td-agent } - { role: haproxy, tags: haproxy }