inventory.j2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # BEGIN Autogenerated hosts
  2. {% for host in groups['all'] %}
  3. {% if hostvars[host].get('ansible_connection', '') == 'local' %}
  4. {{ host }} ansible_connection=local
  5. {% else %}
  6. {{ host }}{% if 'ansible_host' in hostvars[host]
  7. %} ansible_host={{ hostvars[host]['ansible_host'] }}{% endif %}
  8. {% if 'private_v4' in hostvars[host]
  9. %} private_v4={{ hostvars[host]['private_v4'] }}{% endif %}
  10. {% if 'public_v4' in hostvars[host]
  11. %} public_v4={{ hostvars[host]['public_v4'] }}{% endif %}
  12. {% if 'ansible_user' in hostvars[host]
  13. %} ansible_user={{ hostvars[host]['ansible_user'] }}{% endif %}
  14. {% if 'ansible_private_key_file' in hostvars[host]
  15. %} ansible_private_key_file={{ hostvars[host]['ansible_private_key_file'] }}{% endif %}
  16. {% if 'ansible_ssh_extra_args' in hostvars[host]
  17. %} ansible_ssh_extra_args={{ hostvars[host]['ansible_ssh_extra_args']|quote }}{% endif %}
  18. openshift_hostname={{ host }}
  19. {% endif %}
  20. {% endfor %}
  21. # END autogenerated hosts
  22. #[all:vars]
  23. # For all group_vars, see ./group_vars/all.yml
  24. [infra_hosts:vars]
  25. openshift_node_labels={{ openshift_cluster_node_labels.infra | to_json | quote }}
  26. [app:vars]
  27. openshift_node_labels={{ openshift_cluster_node_labels.app | to_json | quote }}
  28. # Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
  29. # The lb group lets Ansible configure HAProxy as the load balancing solution.
  30. # Comment lb out if your load balancer is pre-configured.
  31. [cluster_hosts:children]
  32. OSEv3
  33. dns
  34. [OSEv3:children]
  35. nodes
  36. etcd
  37. # Set variables common for all OSEv3 hosts
  38. #[OSEv3:vars]
  39. # For OSEv3 normal group vars, see ./group_vars/OSEv3.yml
  40. # Host Groups
  41. [masters:children]
  42. masters.{{ stack_name }}
  43. [etcd:children]
  44. etcd.{{ stack_name }}
  45. {% if 'etcd' not in groups or groups['etcd']|length == 0 %}masters.{{ stack_name }}{% endif %}
  46. [nodes:children]
  47. masters
  48. infra.{{ stack_name }}
  49. nodes.{{ stack_name }}
  50. [infra_hosts:children]
  51. infra.{{ stack_name }}
  52. [app:children]
  53. nodes.{{ stack_name }}
  54. [dns:children]
  55. dns.{{ stack_name }}
  56. # Empty placeholders for all groups of the cluster nodes
  57. [masters.{{ stack_name }}]
  58. [etcd.{{ stack_name }}]
  59. [infra.{{ stack_name }}]
  60. [nodes.{{ stack_name }}]
  61. [app.{{ stack_name }}]
  62. [dns.{{ stack_name }}]
  63. # BEGIN Autogenerated groups
  64. {% for group in groups %}
  65. {% if group not in ['ungrouped', 'all'] %}
  66. [{{ group }}]
  67. {% for host in groups[group] %}
  68. {{ host }}
  69. {% endfor %}
  70. {% endif %}
  71. {% endfor %}
  72. # END Autogenerated groups