openQA: try to make NFS mount changes more robust
On client end, restart mount unit (with daemon-reload) if mount file changes. On server end, run exportfs -r if export config file changes. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
e14052db33
commit
c2023d5560
2 changed files with 10 additions and 0 deletions
|
@ -213,12 +213,17 @@
|
||||||
|
|
||||||
- name: Create exports file
|
- name: Create exports file
|
||||||
template: src=exports.j2 dest=/etc/exports.d/openqa.exports owner=root group=root mode=0644
|
template: src=exports.j2 dest=/etc/exports.d/openqa.exports owner=root group=root mode=0644
|
||||||
|
register: exportsfile
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Enable and start NFS server
|
- name: Enable and start NFS server
|
||||||
service: name=nfs-server enabled=yes state=started
|
service: name=nfs-server enabled=yes state=started
|
||||||
|
|
||||||
|
- name: Refresh exports
|
||||||
|
command: exportfs -r
|
||||||
|
when: exportsfile is changed
|
||||||
|
|
||||||
- name: Set up Apache config
|
- name: Set up Apache config
|
||||||
template: src=openqa.conf.httpd.j2 dest=/etc/httpd/conf.d/openqa.conf owner=root group=root mode=0644
|
template: src=openqa.conf.httpd.j2 dest=/etc/httpd/conf.d/openqa.conf owner=root group=root mode=0644
|
||||||
notify:
|
notify:
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
- name: Create mount unit
|
- name: Create mount unit
|
||||||
template: src=var-lib-openqa-share.mount.j2 dest=/etc/systemd/system/var-lib-openqa-share.mount owner=root group=root mode=0644
|
template: src=var-lib-openqa-share.mount.j2 dest=/etc/systemd/system/var-lib-openqa-share.mount owner=root group=root mode=0644
|
||||||
|
register: sharemount
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
|
@ -22,3 +23,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- var-lib-openqa-share.mount
|
- var-lib-openqa-share.mount
|
||||||
- remote-fs.target
|
- remote-fs.target
|
||||||
|
|
||||||
|
- name: Restart mount if unit changed
|
||||||
|
systemd: name=var-lib-openqa-share.mount state=started daemon_reload=yes
|
||||||
|
when: sharemount is changed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue