service.yml 616 B

1234567891011121314151617181920212223
  1. ---
  2. - name: Populate g_service_masters 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_etcd
  11. add_host:
  12. name: "{{ item }}"
  13. groups: g_service_etcd
  14. with_items: "{{ oo_host_group_exp | default([]) }}"
  15. changed_when: False
  16. - name: Change etcd state on etcd instance(s)
  17. hosts: g_service_etcd
  18. connection: ssh
  19. gather_facts: no
  20. tasks:
  21. - service: name=etcd state="{{ new_cluster_state }}"