service.yml 576 B

123456789101112131415161718192021
  1. ---
  2. - name: Populate g_service_nfs host group if needed
  3. hosts: localhost
  4. gather_facts: no
  5. tasks:
  6. - fail: msg="new_cluster_state is required to be injected in this playbook"
  7. when: new_cluster_state is not defined
  8. - name: Evaluate g_service_nfs
  9. add_host:
  10. name: "{{ item }}"
  11. groups: g_service_nfs
  12. with_items: "{{ oo_host_group_exp | default([]) }}"
  13. changed_when: False
  14. - name: Change state on nfs instance(s)
  15. hosts: g_service_nfs
  16. connection: ssh
  17. gather_facts: no
  18. tasks:
  19. - service: name=nfs-server state="{{ new_cluster_state }}"