nfs.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. # Tasks to statically provision NFS volumes
  3. # Include if not using dynamic volume provisioning
  4. - name: Ensure the /exports/ directory exists
  5. file:
  6. path: /exports/
  7. state: directory
  8. mode: 0755
  9. owner: root
  10. group: root
  11. - name: Ensure the miq-pv0X export directories exist
  12. file:
  13. path: "/exports/{{ item }}"
  14. state: directory
  15. mode: 0775
  16. owner: root
  17. group: root
  18. with_items: "{{ openshift_cfme_pv_exports }}"
  19. - name: Ensure the NFS exports for CFME PVs exist
  20. copy:
  21. src: openshift_cfme.exports
  22. dest: /etc/exports.d/openshift_cfme.exports
  23. register: nfs_exports_updated
  24. - name: Ensure the NFS export table is refreshed if exports were added
  25. command: exportfs -ar
  26. when:
  27. - nfs_exports_updated.changed
  28. ######################################################################
  29. # Create the required CFME PVs. Check out these online docs if you
  30. # need a refresher on includes looping with items:
  31. # * http://docs.ansible.com/ansible/playbooks_loops.html#loops-and-includes-in-2-0
  32. # * http://stackoverflow.com/a/35128533
  33. #
  34. # TODO: Handle the case where a PV template is updated in
  35. # openshift-ansible and the change needs to be landed on the managed
  36. # cluster.
  37. - include: create_pvs.yml
  38. with_items: "{{ openshift_cfme_pv_data }}"