service.yml 1016 B

12345678910111213141516171819202122232425262728293031
  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. - cluster_hosts.yml
  10. tasks:
  11. - fail: msg="cluster_id is required to be injected in this playbook"
  12. when: cluster_id is not defined
  13. - name: Evaluate g_service_masters
  14. add_host:
  15. name: "{{ item }}"
  16. groups: g_service_masters
  17. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  18. ansible_become: "{{ deployment_vars[deployment_type].become }}"
  19. with_items: "{{ master_hosts | default([]) }}"
  20. - name: Evaluate g_service_nodes
  21. add_host:
  22. name: "{{ item }}"
  23. groups: g_service_nodes
  24. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  25. ansible_become: "{{ deployment_vars[deployment_type].become }}"
  26. with_items: "{{ node_hosts | default([]) }}"
  27. - include: ../../common/openshift-node/service.yml
  28. - include: ../../common/openshift-master/service.yml