From ace5dbaa1764803819c01bbaf8a29d8f1e03c70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= Date: Thu, 8 Feb 2018 16:20:50 +0100 Subject: [PATCH] Taskotron: Properly fix imagefactory service Workaround for https://github.com/redhat-imaging/imagefactory/issues/417 --- files/imagefactoryd.service | 12 ++++++++++++ roles/taskotron/imagefactory/tasks/main.yml | 16 ++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 files/imagefactoryd.service diff --git a/files/imagefactoryd.service b/files/imagefactoryd.service new file mode 100644 index 0000000000..83d2341334 --- /dev/null +++ b/files/imagefactoryd.service @@ -0,0 +1,12 @@ +[Unit] +Requires=libvirtd.service +After=libvirtd.service + +[Service] +Type=forking +ExecStart=/usr/bin/imagefactoryd +ExecStop=/usr/bin/killall imagefactoryd +PIDFile=/var/run/imagefactoryd.pid + +[Install] +WantedBy=multi-user.target diff --git a/roles/taskotron/imagefactory/tasks/main.yml b/roles/taskotron/imagefactory/tasks/main.yml index d28843714f..85a5ec8b51 100644 --- a/roles/taskotron/imagefactory/tasks/main.yml +++ b/roles/taskotron/imagefactory/tasks/main.yml @@ -16,12 +16,16 @@ - name: hotfix imagefactory's REST api to allow file download copy: src=hotfix_imgfac_RESTv2.py dest=/usr/lib/python2.7/site-packages/imgfac/rest/RESTv2.py owner=root group=root mode=0644 -- name: allow imagefactoryd.service to be enabled - blockinfile: - path: /usr/lib/systemd/system/imagefactoryd.service - block: | - [Install] - WantedBy=multi-user.target +# Workaround for https://github.com/redhat-imaging/imagefactory/issues/417 +- name: fix issues in imagefactoryd.service + copy: + src: imagefactoryd.service + dest: /etc/systemd/system/imagefactoryd.service + register: imagefactory_service + +- name: reload systemd + command: systemctl daemon-reload + when: imagefactory_service.changed - name: enable imagefactory service: name=imagefactoryd state=started enabled=yes