service.yml 591 B

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