retrace: Drop devel variable in favour of env

`env` seems to be the prevailing method of specifying production vs.
staging environments across groups and hosts.
This commit is contained in:
Matěj Grabovský 2021-06-08 14:18:41 +02:00
parent 4cfe740fc6
commit 2ce5a4b91b
6 changed files with 9 additions and 12 deletions

View file

@ -1,4 +1,6 @@
---
env: production
primary_auth_source: ipa
ipa_host_group: retrace
ipa_host_group_desc: Retrace servers
@ -22,8 +24,6 @@ custom_rules:
nrpe_procs_warn: 1800
nrpe_procs_crit: 2000
devel: false
# Since retrace is on the qa network, it needs to actively connect to our
# inbound relay.
fedmsg_active: True

View file

@ -1,11 +1,12 @@
---
env: staging
ipa_host_group: retrace
ipa_host_group_desc: Retrace servers
ipa_client_shell_groups:
- retrace
ipa_client_sudo_groups:
- retrace
devel: true
vpn: true

View file

@ -96,7 +96,7 @@
job: "faf archive-reports -d >> /var/log/faf/archive-reports.log 2>&1"
special_time: daily
state: present
when: not devel|bool
when: env != 'staging'
- name: Cron job for deleting old archives
cron:

View file

@ -7,7 +7,6 @@
special_time: daily
state: present
loop: "{{ rs_internal_fedora_vers | product(rs_internal_arch_list) | list }}"
when: not devel|bool
- name: Remove retrace-server reposync cron jobs of removed Fedora versions
cron:
@ -17,7 +16,6 @@
special_time: daily
state: absent
loop: "{{ rs_internal_fedora_vers_removed | product(rs_internal_arch_list) | list}}"
when: not devel|bool
- name: Create retrace-server reposync cron job for CentOS 7
cron:
@ -26,7 +24,6 @@
job: "/usr/bin/retrace-server-reposync centos 7 x86_64 >> /var/log/retrace-server/reposync_error.log 2>&1"
special_time: daily
state: present
when: not devel|bool
- name: Create retrace-server cleanup cron job
cron:
@ -35,7 +32,6 @@
job: "/usr/bin/retrace-server-cleanup >> /var/log/retrace-server/cleanup_error.log 2>&1"
special_time: daily
state: present
when: not devel|bool
- name: Create cron job for retrace-server
cron:
@ -44,4 +40,3 @@
job: "/usr/bin/podman system prune --all --force >> /var/log/retrace-server/podman_prune.log 2>&1"
special_time: daily
state: present
when: not devel|bool

View file

@ -3,6 +3,7 @@
# Setup retrace-server
- import_tasks: retrace_setup.yml
# Set up cron jobs for retrace-server
# Set up production cron jobs for retrace-server
- import_tasks: cron.yml
tags: cron
when: env != 'staging'

View file

@ -7,14 +7,14 @@
become: yes
become_user: retrace
tags: [rs_reposync, rs_fedora]
when: not devel|bool
when: env != 'staging'
- name: reposync for centos
shell: nohup retrace-server-reposync centos 7 x86_64 </dev/null >$(mktemp /tmp/ansible.reposync_for_centosXXXXXX.log) &
become: yes
become_user: retrace
tags: [rs_reposync, rs_fedora]
when: not devel|bool
when: env != 'staging'
- file:
path: /srv/retrace/repos