service.yml 690 B

1234567891011121314151617181920212223242526
  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:
  12. name: "{{ item }}"
  13. groups: g_service_nodes
  14. with_items: "{{ oo_host_group_exp | default([]) }}"
  15. changed_when: False
  16. - name: Change state on node instance(s)
  17. hosts: g_service_nodes
  18. connection: ssh
  19. gather_facts: no
  20. tasks:
  21. - name: Change state on node instance(s)
  22. service:
  23. name: "{{ service_type }}-node"
  24. state: "{{ new_cluster_state }}"