service.yml 1.0 KB

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