inventory.j2 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 use_bastion|bool and 'ansible_ssh_extra_args' in hostvars[host]
  17. %} ansible_ssh_extra_args={{ hostvars[host]['ansible_ssh_extra_args']|quote }}{% endif %} openshift_hostname={{ host }}
  18. {% endif %}
  19. {% endfor %}
  20. # END autogenerated hosts
  21. #[all:vars]
  22. # For all group_vars, see ./group_vars/all.yml
  23. [infra_hosts:vars]
  24. openshift_node_labels={{ openshift_cluster_node_labels.infra | to_json | quote }}
  25. [app:vars]
  26. openshift_node_labels={{ openshift_cluster_node_labels.app | to_json | quote }}
  27. # Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
  28. # The lb group lets Ansible configure HAProxy as the load balancing solution.
  29. # Comment lb out if your load balancer is pre-configured.
  30. [cluster_hosts:children]
  31. OSEv3
  32. dns
  33. [OSEv3:children]
  34. nodes
  35. etcd
  36. lb
  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. [lb:children]
  57. lb.{{ stack_name }}
  58. # Empty placeholders for all groups of the cluster nodes
  59. [masters.{{ stack_name }}]
  60. [etcd.{{ stack_name }}]
  61. [infra.{{ stack_name }}]
  62. [nodes.{{ stack_name }}]
  63. [app.{{ stack_name }}]
  64. [dns.{{ stack_name }}]
  65. [lb.{{ stack_name }}]
  66. # BEGIN Autogenerated groups
  67. {% for group in groups %}
  68. {% if group not in ['ungrouped', 'all'] %}
  69. [{{ group }}]
  70. {% for host in groups[group] %}
  71. {{ host }}
  72. {% endfor %}
  73. {% endif %}
  74. {% endfor %}
  75. # END Autogenerated groups