Skip to content

entrepreneur-interet-general/gobelins-devops

Repository files navigation

Gobelins DevOps

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.

Server provisionning

  1. Install Ansible. See Ansible documentation

  2. For testing purposes, you may provision a local Vagrant VM.

vagrant up
  1. 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
  1. 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
  1. Or provision the staging server:
ansible-playbook --vault-password-file=vault_password -i inventory/online site.yml  --limit=staging -K

Application deployment

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

Adding encrypted variables

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

Credits

License

MIT

Copyright © 2019 Ministère de la Culture Mobilier national et manufactures des Gobelins, de Beauvais et de la Savonnerie.

About

A collection of Ansible playbooks for the Gobelins projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published