Ansible project to provision and deploy a base instance of Tryton
This project has been thinked to run in Ubuntu 16.04 (Xenial).
- Ansible 2.1 or last
You can find more information about Ansible here
Download Ansible community roles:
ansible-galaxy install -r requirements.yml
We use the next roles:
- postgresql v1.3.1
This playbook manages the sysadmin users.
Need user with sudo
access without password
Add your sys_admins
list in your inventory/hosy_vars/
file.
sys_admins
is a list of maps. Need tree keys: name
, ssh_key
and state
:
# ./inventory/host_vars/local.tryton.org/config.yml
...
sys_admins:
- name: tryton
ssh_key: "~/.ssh/id_rsa.pub"
state: present
- name: "{{ development_user }}"
ssh_key: "~/.ssh/id_rsa.pub"
state: present
...
To execute the playbook run:
> ansible-playbook playbooks/sys_admins.yml -u root --limit=dev -v
Change root
for your user.
Configure your hosts and group vars:
# inventory/group_vars/all.yml
# User name and password for running ansible on host
user: ubuntu
venv_path: "{{ ansible_env.HOME }}/.venv"
postgresql_users:
- name: ubuntu
role_attr_flags: CREATEDB
postgresql_databases:
- name: tryton-db
Then run:
ansible-playbook playbooks/provision.yml -u ubuntu
If you need a development environment you can create a LXC container to easy create and destroy it.
You can use scripts/create_role.sh
script to manage the createation:
> scripts/create_container.sh
At end of script, it plays the sys_admins.yml
playbook and generate the sys admins users.
To change the default values of the script variables look at scripts/config/lxc.cfg
file.
- Fork it (https://github.com/danypr92/tryton-install)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request