summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_nfs/tasks
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2016-11-18 14:26:02 -0500
committerRussell Teague <rteague@redhat.com>2016-11-28 11:11:44 -0500
commitec9c22ca6a376b7d1139a384dcb78f3f5bb5b607 (patch)
treea8c3897b9765b9b6dc02582a851b704be8f0828e /roles/openshift_storage_nfs/tasks
parentb45db4c7e0b278623f7531cee50127aa24686139 (diff)
downloadopenshift-ec9c22ca6a376b7d1139a384dcb78f3f5bb5b607.tar.gz
openshift-ec9c22ca6a376b7d1139a384dcb78f3f5bb5b607.tar.bz2
openshift-ec9c22ca6a376b7d1139a384dcb78f3f5bb5b607.tar.xz
openshift-ec9c22ca6a376b7d1139a384dcb78f3f5bb5b607.zip
Refactored to use Ansible systemd module
* Ansible systemd module used in place of service module * Refactored command tasks which are no longer necessary * Applying rules from openshift-ansible Best Practices Guide
Diffstat (limited to 'roles/openshift_storage_nfs/tasks')
-rw-r--r--roles/openshift_storage_nfs/tasks/main.yml18
1 files changed, 8 insertions, 10 deletions
diff --git a/roles/openshift_storage_nfs/tasks/main.yml b/roles/openshift_storage_nfs/tasks/main.yml
index ecc52e4af..fd935f105 100644
--- a/roles/openshift_storage_nfs/tasks/main.yml
+++ b/roles/openshift_storage_nfs/tasks/main.yml
@@ -10,7 +10,7 @@
register: nfs_config
- name: Restart nfs-config
- service: name=nfs-config state=restarted
+ systemd: name=nfs-config state=restarted
when: nfs_config | changed
- name: Ensure exports directory exists
@@ -26,9 +26,9 @@
owner: nfsnobody
group: nfsnobody
with_items:
- - "{{ openshift.hosted.registry }}"
- - "{{ openshift.hosted.metrics }}"
- - "{{ openshift.hosted.logging }}"
+ - "{{ openshift.hosted.registry }}"
+ - "{{ openshift.hosted.metrics }}"
+ - "{{ openshift.hosted.logging }}"
- name: Configure exports
@@ -36,7 +36,7 @@
dest: /etc/exports.d/openshift-ansible.exports
src: exports.j2
notify:
- - restart nfs-server
+ - restart nfs-server
# Now that we're putting our exports in our own file clean up the old ones
- name: register exports
@@ -51,16 +51,14 @@
with_items: "{{ exports_out.stdout_lines | default([]) }}"
when: exports_out.rc == 0
notify:
- - restart nfs-server
+ - restart nfs-server
- name: Enable and start services
- service:
- name: "{{ item }}"
+ systemd:
+ name: nfs-server
state: started
enabled: yes
register: start_result
- with_items:
- - nfs-server
- set_fact:
nfs_service_status_changed: "{{ start_result | changed }}"