service.yml 1.1 KB

12345678910111213141516171819202122232425262728
  1. ---
  2. - name: Call same systemctl command for openshift on all instance(s)
  3. hosts: localhost
  4. connection: local
  5. become: no
  6. gather_facts: no
  7. vars_files:
  8. - vars.yml
  9. tasks:
  10. - fail: msg="cluster_id is required to be injected in this playbook"
  11. when: cluster_id is not defined
  12. - add_host:
  13. name: "{{ item }}"
  14. groups: g_service_nodes
  15. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
  16. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  17. with_items: "{{ g_node_hosts | default([]) | difference(['localhost']) | difference(groups.status_terminated) }}"
  18. - add_host:
  19. name: "{{ item }}"
  20. groups: g_service_masters
  21. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
  22. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  23. with_items: "{{ g_master_hosts | default([]) | difference(['localhost']) | difference(groups.status_terminated) }}"
  24. - include: ../../common/openshift-node/service.yml
  25. - include: ../../common/openshift-master/service.yml