updating taskotron roles to use dnf for f22+, variable for repos

This commit is contained in:
Tim Flink 2015-09-30 21:57:46 +00:00
parent 3f3709c369
commit bdbf4f8615
11 changed files with 98 additions and 35 deletions

View file

@ -1,13 +1,23 @@
- name: ensure packages required for buildmaster are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepos={{ extra_enablerepos }}
with_items:
- buildbot
- buildbot-master
- libsemanage-python
- python-psycopg2
when: ansible_distribution_major_version|int < 22
- name: ensure packages required for buildmaster are installed
action: yum name={{ item }} state=latest
dnf: name={{ item }} state=latest enablerepos={{ extra_enablerepos }}
with_items:
- buildbot
- buildbot-master
- libsemanage-python
- python-psycopg2
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: ensure packages required for buildmaster are installed
action: dnf name={{ item }} state=latest
when: deployment_type == 'qadevel-prod' or deployment_type == 'qa-stg'
with_items:
- python-novaclient

View file

@ -1,5 +1,5 @@
- name: ensure packages required for buildslave are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepos={{ extra_enablerepos }}
with_items:
- buildbot-slave
- git
@ -13,6 +13,24 @@
- pylint
- python-pep8
- moreutils
when: ansible_distribution_major_version|int < 22
- name: ensure packages required for buildslave are installed (f22+)
dnf: name={{ item }} state=latest enablerepos={{ extra_enablerepos }}
with_items:
- buildbot-slave
- git
- rpmlint
- koji
- bodhi-client
- python-virtualenv
- gcc
- libcurl-devel
- rpm-build
- pylint
- python-pep8
- moreutils
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: add the buildslave user
user: name=buildslave

View file

@ -1,5 +1,5 @@
- name: ensure packages required for execdb are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest
when: deployment_type == 'prod' or deployment_type == 'local'
with_items:
- execdb
@ -7,14 +7,14 @@
- python-psycopg2
- libsemanage-python
- name: ensure packages required for execdb are installed (testing)
action: yum name={{ item }} state=latest enablerepo=infrastructure-testing
when: deployment_type == 'dev' or deployment_type == 'stg'
- name: ensure packages required for execdb are installed (f22+)
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- execdb
- mod_wsgi
- python-psycopg2
- libsemanage-python
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: ensure database is created
delegate_to: "{{ execdb_db_host }}"
@ -27,7 +27,7 @@
delegate_to: "{{ execdb_db_host }}"
sudo_user: postgres
sudo: true
action: postgresql_user db={{ execdb_db_name }} user={{ dev_execdb_db_user }} password={{ dev_execdb_db_password }} role_attr_flags=NOSUPERUSER
action: postgresql_user db={{ execdb_db_name }} user={{ execdb_db_user }} password={{ execdb_db_password }} role_attr_flags=NOSUPERUSER
- name: ensure stg execdb db user has access to stg database
when: deployment_type == 'stg'

View file

@ -1,8 +1,16 @@
- name: ensure grokmirror packages are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- git
- python-grokmirror
when: ansible_distribution_major_version|int < 22
- name: ensure grokmirror packages are installed
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- git
- python-grokmirror
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: create grokmirror user
user: name={{ grokmirror_user }}

View file

@ -1,5 +1,5 @@
- name: ensure packages required for resultsdb are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest
when: deployment_type == 'prod' or deployment_type == 'local'
with_items:
- resultsdb
@ -8,8 +8,8 @@
- libsemanage-python
- name: ensure packages required for resultsdb are installed (infra-testing)
action: yum name={{ item }} state=latest enablerepo=infrastructure-testing
when: deployment_type == 'dev' or deployment_type == 'stg'
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
with_items:
- resultsdb
- mod_wsgi
@ -17,17 +17,17 @@
- libsemanage-python
- name: ensure database is created
delegate_to: "{{ resultsdb_db_host }}"
delegate_to: "{{ resultsdb_db_host_machine }}"
sudo_user: postgres
sudo: true
action: postgresql_db db={{ resultsdb_db_name }}
- name: ensure dev resultsdb db user has access to dev database
when: deployment_type == 'dev'
delegate_to: "{{ resultsdb_db_host }}"
delegate_to: "{{ resultsdb_db_host_machine }}"
sudo_user: postgres
sudo: true
action: postgresql_user db={{ resultsdb_db_name }} user={{ dev_resultsdb_db_user }} password={{ dev_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
action: postgresql_user db={{ resultsdb_db_name }} user={{ resultsdb_db_user }} password={{ resultsdb_db_password }} role_attr_flags=NOSUPERUSER
- name: ensure stg resultsdb db user has access to stg database
when: deployment_type == 'stg'

View file

@ -1,16 +1,16 @@
- name: ensure packages required for resultsdb_frontend are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
when: deployment_type == 'prod' or deployment_type == 'local'
with_items:
- resultsdb_frontend
- mod_wsgi
- name: ensure packages required for resultsdb_frontend are installed (infra-testing)
action: yum name={{ item }} state=latest enablerepo=infrastructure-testing
when: deployment_type == 'dev' or deployment_type == 'stg'
- name: ensure packages required for resultsdb_frontend are installed (f22+)
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- resultsdb_frontend
- mod_wsgi
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: generate resultsdb_frontend config
template: src=settings.py.j2 dest=/etc/resultsdb_frontend/settings.py owner=root group=root mode=0644

View file

@ -1,7 +1,14 @@
- name: ensure ssl related packages are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- mod_ssl
when: ansible_distribution_major_version|int < 22
- name: ensure ssl related packages are installed
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- mod_ssl
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: copy ssl key
copy: src={{ private }}/files/taskotron/certs/{{ inventory_hostname }}/{{ inventory_hostname }}.key dest=/etc/pki/tls/private/{{ inventory_hostname }}.key

View file

@ -1,25 +1,35 @@
- name: ensure packages required for libtaskotron are installed
action: yum name={{ item }} state=latest
when: deployment_type == 'prod' or deployment_type == 'local'
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- PyYAML
- libtaskotron
- resultsdb_api
when: deployment_type == 'prod' or deployment_type == 'local'
- name: ensure packages required for libtaskotron are installed (infra-testing)
action: yum name={{ item }} state=latest enablerepo=infrastructure-testing
- name: ensure packages required for libtaskotron are installed (f22+)
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
when: deployment_type == 'dev' or deployment_type == 'stg'
with_items:
- PyYAML
- libtaskotron
- resultsdb_api
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: ensure packages required for taskotron tasks are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- python-solv
- python-librepo
- rpmlint
when: ansible_distribution_major_version|int < 22
- name: ensure packages required for taskotron tasks are installed (f22+)
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- python-solv
- python-librepo
- rpmlint
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: generate taskotron.yaml config file
template: src=taskotron.yaml.j2 dest=/etc/taskotron/taskotron.yaml owner=root group=root mode=0644
@ -31,9 +41,5 @@
- name: set baseurl of yumrepoinfo.conf
replace: dest=/etc/taskotron/yumrepoinfo.conf regexp='baseurl = http://download\.fedoraproject\.org/.*' replace='baseurl = http://infrastructure.fedoraproject.org/pub/fedora/linux'
# disabled for now until interaction with hosts role is figured out
#- name: update /etc/hosts so that koji downloads work
# template: src=hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
- name: create /var/log/taskotron for task logfiles
file: path=/var/log/taskotron state=directory owner={{ slave_user }} group={{ slave_user }} mode=1755

View file

@ -1,7 +1,14 @@
- name: ensure packages required for taskotron-frontend are installed
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- httpd
when: ansible_distribution_major_version|int < 22
- name: ensure packages required for taskotron-frontend are installed (f22+)
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- httpd
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: create dirs for static files
file: path=/var/www/html/{{ item }} state=directory owner=apache group=apache mode=1755

View file

@ -4,9 +4,16 @@
# closer to stg/prod
- name: ensure packages required for proxying are installedc
action: yum name={{ item }} state=latest
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- libsemanage-python
when: ansible_distribution_major_version|int < 22
- name: ensure packages required for proxying are installedc
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- libsemanage-python
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: allow httpd tcp connections with selinux
seboolean: name=httpd_can_network_connect state=true persistent=yes

View file

@ -1,22 +1,22 @@
- name: ensure packages required for taskotron-trigger are installed
action: yum name={{ item }} state=latest
when: deployment_type == 'prod' or deployment_type == 'local'
yum: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- fedmsg
- fedmsg-hub
- taskotron-trigger
# needed for cron script
- resultsdb_api
when: deployment_type == 'prod' or deployment_type == 'local'
- name: ensure packages required for taskotron-trigger are installed (infra-testing)
action: yum name={{ item }} state=latest enablerepo=infrastructure-testing
when: deployment_type == 'dev' or deployment_type == 'stg'
dnf: name={{ item }} state=latest enablerepo={{ extra_enablerepos }}
with_items:
- fedmsg
- fedmsg-hub
- taskotron-trigger
# needed for cron script
- resultsdb_api
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- name: generate trigger configuration
template: src=trigger.cfg.j2 dest=/etc/taskotron/trigger.cfg owner=root group=root mode=0744