Installs {{cookiecutter.service_name}} on Ubuntu 16.04 (Xenial)
This role requires Ansible {{cookiecutter.ansible_min_version}} or higher.
The role defines most of its variables in defaults/main.yml
:
Run with default vars:
- hosts: all
roles:
- { role: {{cookiecutter.role_name}} }
Tests are performed using Molecule.
Install Molecule or use docker-compose run --rm molecule
to run a local Docker container, based on the enterclousuite/molecule project, from where you can use molecule
.
- Run
molecule create
to start the target Docker container on your local engine. - Use
molecule login
to log in to the running container. - Edit the role files.
- Add other required roles (external) in the molecule/default/requirements.yml file.
- Edit the molecule/default/playbook.yml.
- Define infra tests under the molecule/default/tests folder using the goos verifier.
- When ready, use
molecule converge
to run the Ansible Playbook andmolecule verify
to execute the test suite.
Note that the converge process starts performing a syntax check of the role.
Destroy the Docker container with the commandmolecule destroy
.
To run all the steps with just one command, run molecule test
.
In order to run the role targeting a VM, use the playbook_deploy.yml file for example with the following command: ansible-playbook {{cookiecutter.role_name}}/molecule/default/playbook_deploy.yml -i VM_IP_OR_FQDN, -u ubuntu --private-key private.pem
.
Tested on Ubuntu - Centos
Name | Description | Default Value |
---|---|---|
uwsgi_version: | Softwere Version | Lastes |
environmentFile: | /etc/sysconfig/uwsgi | |
uwsgi_bin_path: | Path uwsgi Binary file | /sbin |
uwsgi_run: | Unix Data socket | /run/uwsgi |
uwsgi_run_stats: | Unix stats socket | /run/uwsgi/stat |
uwsgi_log_path: | Log | /var/log/uwsgi |
uwsgi_user: | uWsgi User | nginx |
uwsgi_group: | uWsgi Group | nginx |
uwsgi_ini_path: | Main uWsgi Config file | /etc |
For python deply is recommended use vrtualenv. Usualy the virtualenv home is specified in venv role variable, in this case set this variable as the variable se in your venv role.
Name | Description | Default Value |
---|---|---|
venv_home | Virtual Env Path | /usr/venv |
- name: run uwsgi roles
hosts: all
roles:
- role: ansible-uwsgi