remove a bunch of taskotron-specific stuff from buildmaster into taskotron master, add tmpwatch cronjob
This commit is contained in:
parent
1ad563886f
commit
e1cc854acf
6 changed files with 28 additions and 22 deletions
|
@ -52,6 +52,7 @@
|
||||||
- { role: taskotron/buildmaster-configure, tags: ['buildmasterconfig'] }
|
- { role: taskotron/buildmaster-configure, tags: ['buildmasterconfig'] }
|
||||||
- { role: taskotron/taskotron-trigger, tags: ['trigger'] }
|
- { role: taskotron/taskotron-trigger, tags: ['trigger'] }
|
||||||
- { role: taskotron/taskotron-frontend, tags: ['frontend'] }
|
- { role: taskotron/taskotron-frontend, tags: ['frontend'] }
|
||||||
|
- { role: taskotron/taskotron-master, tags: ['taskotronmaster'] }
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- include: "{{ handlers }}/restart_services.yml"
|
- include: "{{ handlers }}/restart_services.yml"
|
||||||
|
|
|
@ -45,19 +45,6 @@
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload httpd
|
||||||
|
|
||||||
- name: copy artifacts httpd config
|
|
||||||
template: src=artifacts.conf.j2 dest=/etc/httpd/conf.d/artifacts.conf owner=root group=root
|
|
||||||
when: deployment_type == 'prod' or deployment_type == 'stg' or deployment_type == 'dev' or deployment_type == 'local'
|
|
||||||
notify:
|
|
||||||
- reload httpd
|
|
||||||
|
|
||||||
- name: create artifacts directory
|
|
||||||
file: path={{ item }} state=directory owner=buildmaster group=buildmaster mode=0775 setype=httpd_sys_content_t
|
|
||||||
when: deployment_type == 'prod' or deployment_type == 'stg' or deployment_type == 'dev' or deployment_type == 'local'
|
|
||||||
with_items:
|
|
||||||
- /srv/taskotron
|
|
||||||
- /srv/taskotron/artifacts
|
|
||||||
|
|
||||||
- name: ensure buildmaster database is created
|
- name: ensure buildmaster database is created
|
||||||
when: buildmaster_db_host != 'localhost'
|
when: buildmaster_db_host != 'localhost'
|
||||||
delegate_to: "{{ buildmaster_db_host }}"
|
delegate_to: "{{ buildmaster_db_host }}"
|
||||||
|
@ -66,18 +53,11 @@
|
||||||
postgresql_db: db={{ buildmaster_db_name }}
|
postgresql_db: db={{ buildmaster_db_name }}
|
||||||
|
|
||||||
- name: ensure dev db user has access to dev database
|
- name: ensure dev db user has access to dev database
|
||||||
when: deployment_type == 'dev'
|
when: deployment_type in ['dev', 'stg']
|
||||||
delegate_to: "{{ buildmaster_db_host }}"
|
delegate_to: "{{ buildmaster_db_host }}"
|
||||||
sudo: true
|
sudo: true
|
||||||
sudo_user: postgres
|
sudo_user: postgres
|
||||||
postgresql_user: db={{ buildmaster_db_name }} user={{ dev_buildmaster_db_user }} password={{ dev_buildmaster_db_password }} role_attr_flags=NOSUPERUSER
|
postgresql_user: db={{ buildmaster_db_name }} user={{ buildmaster_db_user }} password={{ buildmaster_db_password }} role_attr_flags=NOSUPERUSER
|
||||||
|
|
||||||
- name: ensure stg db user has access to stg database
|
|
||||||
when: deployment_type == 'stg'
|
|
||||||
delegate_to: "{{ buildmaster_db_host }}"
|
|
||||||
sudo: true
|
|
||||||
sudo_user: postgres
|
|
||||||
postgresql_user: db={{ buildmaster_db_name }} user={{ stg_buildmaster_db_user }} password={{ stg_buildmaster_db_password }} role_attr_flags=NOSUPERUSER
|
|
||||||
|
|
||||||
- name: ensure prod db user has access to prod database
|
- name: ensure prod db user has access to prod database
|
||||||
when: deployment_type == 'prod'
|
when: deployment_type == 'prod'
|
||||||
|
|
3
roles/taskotron/master/defaults/main.yml
Normal file
3
roles/taskotron/master/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
artifacts_max_life: '120d'
|
||||||
|
buildmaster_max_life: '150d'
|
20
roles/taskotron/master/tasks/main.yml
Normal file
20
roles/taskotron/master/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
- name: ensure packages required for buildmaster are installed (dnf)
|
||||||
|
dnf: name={{ item }} state=present enablerepo={{ extra_enablerepos }}
|
||||||
|
with_items:
|
||||||
|
- tmpwatch
|
||||||
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
||||||
|
|
||||||
|
- name: create artifacts directory
|
||||||
|
file: path={{ item }} state=directory owner=buildmaster group=buildmaster mode=0775 setype=httpd_sys_content_t
|
||||||
|
with_items:
|
||||||
|
- /srv/taskotron
|
||||||
|
- /srv/taskotron/artifacts
|
||||||
|
|
||||||
|
- name: copy artifacts httpd config
|
||||||
|
template: src=artifacts.conf.j2 dest=/etc/httpd/conf.d/artifacts.conf owner=root group=root
|
||||||
|
notify:
|
||||||
|
- reload httpd
|
||||||
|
|
||||||
|
- name: copy tmpwatch cronjob for taskotron artifacts and buildmaster
|
||||||
|
template: src=taskotron-tmpwatch.cron.jw dest=/etc/cron.d/taskotron-tmpwatch.cron owner=root group=root mode=0644
|
|
@ -0,0 +1,2 @@
|
||||||
|
0 0 * * * {{ buildmaster_user }} tmpwatch -vv --dirmtime -m -f {{ artifacts_max_life }} {{ public_artifacts_dir }}
|
||||||
|
0 0 * * * {{ buildmaster_user }} tmpwatch -vv --dirmtime -m -f {{ buildmaster_max_life }} {{ public_artifacts_dir }}
|
Loading…
Add table
Add a link
Reference in a new issue