ansible/roles/constellation/tasks/main.yml

71 lines
1.8 KiB
YAML

---
- name: Install constellation dependencies
apt:
update_cache: true
install_recommends: false
name:
- python3-django
- python3-django-crispy-forms
- python3-django-extensions
- python3-django-polymorphic
- python3-djangorestframework
- python3-django-tables2
- python3-ipython
- python3-pip
- python3-psycopg2
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Install constellation pip dependencies
pip:
name:
- django-dnsmanager>=0.2.1
- name: Create constellation directory
file:
path: /var/local/constellation
state: directory
mode: '2775'
owner: "{{ constellation.owner }}"
group: "{{ constellation.group }}"
- name: Set ACL for constellation directory
acl:
path: /var/local/constellation
default: true
entity: nounou
etype: group
permissions: rwx
state: query
ignore_errors: "{{ ansible_check_mode }}"
- name: Clone constellation repository
git:
repo: 'https://gitlab.adm.crans.org/nounous/constellation.git'
dest: /var/local/constellation
umask: '002'
version: "{{ constellation.version }}"
recursive: true
- name: Set owner of cloned project
file:
path: /var/local/constellation
owner: "{{ constellation.owner }}"
group: "{{ constellation.group }}"
recurse: true
- name: Indicate constellation in motd
template:
src: update-motd.d/05-service.j2
dest: /etc/update-motd.d/05-constellation
mode: 0755
- name: Deploy Constellation settings_local.py
template:
src: constellation/settings_local.py.j2
dest: /var/local/constellation/constellation/settings_local.py
mode: 0660
owner: "{{ constellation.settings_local_owner }}"
group: "{{ constellation.settings_local_group }}"