inventory.j2 2.1 KB

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