inventory.j2 1.8 KB

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