taskotron-client: replace vars in yumrepoinfo.conf

Instead of keeping modified version of the config file and merging the
changes every time (which is very error prone - I broke it in
cddf101acb), rather store the vanilla version and perform
modifications on top of it. These modifications will fail if the keys
change, hopefully reducing silent failures.
This commit is contained in:
Kamil Páral 2017-07-11 13:22:50 +02:00
parent 805d423e55
commit 3952106f49

View file

@ -50,6 +50,32 @@
when: deployment_type in ['dev']
copy: src=yumrepoinfo.conf.dev dest=/etc/taskotron/yumrepoinfo.conf owner=root group=root mode=0644
- name: check that baseurl= line exists in yumrepoinfo.conf
command: grep -q '^baseurl =' /etc/taskotron/yumrepoinfo.conf
changed_when: False
- name: check that baseurl_altarch= line exists in yumrepoinfo.conf
command: grep -q '^baseurl_altarch =' /etc/taskotron/yumrepoinfo.conf
changed_when: False
- name: set infra repo for baseurl in yumrepoinfo.conf
lineinfile:
path: /etc/taskotron/yumrepoinfo.conf
regexp: '^baseurl ='
line: 'baseurl = http://infrastructure.fedoraproject.org/pub/fedora/linux'
- name: set infra repo for baseurl_altarch in yumrepoinfo.conf
lineinfile:
path: /etc/taskotron/yumrepoinfo.conf
regexp: '^baseurl_altarch ='
line: 'baseurl_altarch = http://infrastructure.fedoraproject.org/pub/fedora-secondary'
- name: make sure there's no download.fp.o leftover in yumrepoinfo.conf
command: grep -qE '^[^#].*/download.fedoraproject.org/' /etc/taskotron/yumrepoinfo.conf
changed_when: False
register: result
failed_when: result.rc != 1
- name: create /var/log/taskotron for task logfiles
file: path=/var/log/taskotron state=directory owner={{ slave_user }} group={{ slave_user }} mode=1755
when: deployment_type == 'local'