diff --git a/group_vars/constellation.yml b/group_vars/constellation.yml index e3ace5a716ac6012dc4d3866050cf26d8eca7860..728aeb3c3d2121ef682c10b6f843871de6b2f553 100644 --- a/group_vars/constellation.yml +++ b/group_vars/constellation.yml @@ -20,7 +20,8 @@ glob_constellation: user: 'constellation' password: "{{ vault.constellation_django_db_password }}" name: 'constellation' - front: True + front: true + crontab: true applications: - 'access' - 'billing' diff --git a/roles/constellation/tasks/main.yml b/roles/constellation/tasks/main.yml index 2e2a415404b715efce2451d990b6e8a0e8801bfc..8da6d591c6918c71fb1bc1c8c3aa9ca9cbde551d 100644 --- a/roles/constellation/tasks/main.yml +++ b/roles/constellation/tasks/main.yml @@ -69,6 +69,14 @@ version: "{{ constellation.version }}" recursive: true +- name: Install pip module with editable flag (development) + when: constellation.version != "master" + pip: + name: + - "{{ project_path }}" + editable: true + state: latest + - name: Install and upgrade constellation (production) when: constellation.version == "master" pip: @@ -99,6 +107,15 @@ dest: "{{ project_path }}/settings_local.py" state: link +- name: Deploy crontab + when: constellation.crontab + template: + src: "cron.d/constellation.j2" + dest: "/etc/cron.d/constellation" + owner: root + group: root + mode: 0644 + - name: Compile messages when: not constellation.front django_manage: diff --git a/roles/constellation/templates/cron.d/constellation.j2 b/roles/constellation/templates/cron.d/constellation.j2 new file mode 100644 index 0000000000000000000000000000000000000000..c87dbea9abb73dde0b9c022c62fcf9172e33f593 --- /dev/null +++ b/roles/constellation/templates/cron.d/constellation.j2 @@ -0,0 +1,4 @@ +{{ ansible_header }} + +# m h dom mon dow user command +24 4 * * * root constellation check_consistency