This is a collection of Ansible playbooks for the Gobelins and Gobelins Datasource projets.
It handles installing the required stack (Nginx, PostgreSQL, Elasticsearch…), and deploying the application code (git pull, frontend asset compilation, database migrations…).
It is based on Barn for installation of most of the Laravel stack, but also uses geerlingguy.postgresql and Ansitrano for deployment.
-
Install Ansible. See Ansible documentation
-
For testing purposes, you may provision a local Vagrant VM.
vagrant up
- Setting up support for Ansible Vault. You can either be prompted for the vault password every time you run the playbook, or save it locally in a file, as so:
echo 'thepassword' > vault_password # <- replace with real password provided.
chmod 0400 vault_password
- Install the required stack on your local VM provisionned with Vagrant:
ansible-playbook --vault-password-file=vault_password -i inventory/vagrant site.yml --limit=development -K
- Or provision the staging server:
ansible-playbook --vault-password-file=vault_password -i inventory/online site.yml --limit=staging -K
1/ Deploy the code :
ansible-playbook --vault-password-file=vault_password -i inventory/online deploy-datasource.yml --limit=staging -K
ansible-playbook --vault-password-file=vault_password -i inventory/online deploy-gobelins.yml --limit=staging -K
2/ Copy SCOM dump files to the target of SCOM_DUMP_FILE_PATH
in .env
.
3/ Run the import task
php artisan gobelins:import_scom
You’ll need the vault password. We use the same password for all strings in all the variable files.
ansible-vault encrypt_string 'supersecretstring' --name 'label_name' --vault-password-file=vault_password
- Ned Baldessin
- Lasse Lehtinen author of Barn
- Jeff Geerling author of geerlingguy.postgresql
- Carlos Buenosvinos author of Ansitrano
Copyright © 2019 Ministère de la Culture Mobilier national et manufactures des Gobelins, de Beauvais et de la Savonnerie.