In our daily work we often have the need to plan periodic or recurring activities. In the past this activity has always been managed using cron. This obliges us, always, to have a server on which to schedule activities. In recent years we have been using Serverless services with increasing…
Devops
In this article we will describe how we have automated a workflow thanks to the services managed by Amazon AWS. This has allowed us to have a unique and centralized service that can be managed by anyone. Let’s come to the problem. To manage hundreds of DNS zones for our…
When we started developing Lambda functions to automate processes, or simply to delegate various jobs, compared to our infrastructure, we faced the problem of how to handle the deploy of functions and maintain the versions of this code. There are many frameworks, more or less useful and well done, but…
Negli ultimi anni, gli amministratori di sistema sempre più spesso sentono l’esigenza di trovare strumenti per difendersi da attacchi DoS o DDoS. La diffusione di questo tipo di attacchi in futuro sarà sempre maggiore al crescere della capacità di banda delle connessioni casalinghe e non solo, ma anche per il…
Il servizio AWS S3 (Simple Storage Service) è nato e si è diffuso per la sua caratteristica di essere uno storage ad oggetti, semplice da usare, sicuro e, in alcuni casi, anche economico. I nostri oggetti presenti su S3 possono essere gestiti attraverso l’API, la GUI e l’SDK messi a disposizione da…
Martedi 9 Gennaio 2018 Madisoft sarà al Cowo42 di Osimo (AN) per parlare di scalabilità di applicazioni PHP. Partendo da sfide affrontate quotidianamente sul nostro software Nuvola, vedremo come siamo riusciti a scalare con successo l’applicazione per gestire milioni di visite e miliardi di dati. La serata è gratuita, compresa la…
In the previous articles we created our infrastructure on AWS and configured the services. All this using Ansible and creating an infrastructure as code. In this article we will describe the steps we have followed to migrate our infrastructure to AWS. Warm up The switch off and switch on was done on…
In the previous articles we created our infrastructure on AWS and configured the services. All using Ansible and creating an infrastructure as code. When the number of servers or services grows, keeping track of their names clearly can be complicated. This article describes how to manage your servers automatically using AWS Route53….
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…
In the previous article we described the reasons that made us change the provider. In this article we will describe how we built our infrastructure as code. As a first step let’s create a bash script to run the playbook:
1 2 3 4 5 6 7 8 9 10 11 |
:~$ ./infrastructure_nuvola_env_aws.sh --env prod #!/bin/bash . libs/extra_option_parser.sh … ansible-playbook --vault-password-file secrets/infrastructure_nuvola_env.secret \ ansible/infrastucture_nuvola_env.yml \ -e"$EXTRA_OPTIONS" |
With the flexibility of AWS & Ansible we can easily craft an isolated…