service.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. # TODO: need to figure out a plan for setting hostname, currently the default
  3. # is localhost, so no hostname value (or public_hostname) value is getting
  4. # assigned
  5. - name: Call same systemctl command for openshift on all instance(s)
  6. hosts: localhost
  7. gather_facts: no
  8. vars_files:
  9. - vars.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. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  17. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  18. groups: g_service_masters
  19. with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-master"] | default([])
  20. - name: Evaluate g_service_nodes
  21. add_host:
  22. name: "{{ item }}"
  23. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  24. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  25. groups: g_service_nodes
  26. with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-node"] | default([])
  27. - include: ../../common/openshift-node/service.yml
  28. - include: ../../common/openshift-master/service.yml