In the previous article we showed you how we created our infrastructure as code. This article describes how to configure services within our EC2 instances. Provision Backend Let’s start with a bash script to run the playbooks:
1 2 3 4 5 6 7 8 |
./provision_nuvola_backend.sh --limit "tag_nuvola_type_${ENV}_backend" ./provision_nuvola_dbserver.sh --limit "tag_nuvola_type_${ENV}_database" ./provision_nuvola_routine.sh --limit "tag_nuvola_type_${ENV}_routine" if [ "$ENV" != "prod" ]; then ./nuvola-init-not-prod-env.sh --env ${ENV} ./deploy_nuvola.sh --limit "tag_nuvola_type_${ENV}_backend" --env ${ENV} fi |
Here is the playbook used to configure backend services:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
- hosts: all vars_files: - vars/system.yml - vars/packages.yml - vars/php_prod.yml - vars/vars_newrelic.yml - vars/vars_backend.yml - vars/vars_backend_secure.yml - "inventories/group_vars/regions.yml" handlers: - include: roles/newrelic/handlers/main.yml tasks: - include: roles/init/tasks/init_upgrade_generic.yml tags: init - include: roles/init/tasks/init_nuvola_dns_updater.yml tags: dns - include: roles/init/tasks/init_nuvola_backend.yml tags: init - include: roles/php7/tasks/php7_prod.yml tags: php - include: roles/nginx/tasks/nginx_prod.yml tags: nginx - include: roles/newrelic/tasks/newrelic_php7.yml tags: newrelic - include: roles/rabbitmq/tasks/rabbitmq_php.yml tags: rabbitmq_php - include: roles/logstash/tasks/logstash_forwarder_all.yml tags: logstash - include: roles/cloudwatch-logs-agent/tasks/cloudwatch-logs-agent.yml tags: cloudwatch - include: roles/webserver/tasks/finalize.yml tags: webserver - include: roles/deploy-nuvola/tasks/auto-deploy.yml tags: auto-deploy |
Let’s focus on php…