agent-config-template.yaml.j2 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. apiVersion: v1alpha1
  2. kind: AgentConfig
  3. metadata:
  4. name: {{ install_type }}-cluster
  5. rendezvousIP: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['address'] }}
  6. additionalNTPSources:
  7. - 192.168.50.254
  8. hosts:
  9. - hostname: {{ hostvars[install_host]['inventory_hostname_short'] }}
  10. role: master
  11. rootDeviceHints:
  12. deviceName: /dev/sda
  13. interfaces:
  14. - name: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['interface'] }}
  15. macAddress: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['macaddress'] }}
  16. networkConfig:
  17. interfaces:
  18. - name: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['interface'] }}
  19. type: ethernet
  20. state: up
  21. mac-address: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['macaddress'] }}
  22. ipv4:
  23. enabled: true
  24. address:
  25. - ip: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['address'] }}
  26. prefix-length: 24
  27. dhcp: false
  28. dns-resolver:
  29. config:
  30. server:
  31. - 192.168.50.254
  32. routes:
  33. config:
  34. - destination: 0.0.0.0/0
  35. next-hop-address: 127.0.0.1
  36. next-hop-interface: {{ hostvars[install_host]['ansible_facts']['default_ipv4']['interface'] }}
  37. table-id: 254
  38. {% if install_type == 'ipi' %}
  39. {% for node in other_hosts %}
  40. - hostname: {{ hostvars[node.name]['inventory_hostname_short'] }}
  41. role: {{ node.role }}
  42. rootDeviceHints:
  43. deviceName: /dev/sda
  44. interfaces:
  45. - name: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['interface'] }}
  46. macAddress: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['macaddress'] }}
  47. networkConfig:
  48. interfaces:
  49. - name: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['interface'] }}
  50. type: ethernet
  51. state: up
  52. mac-address: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['macaddress'] }}
  53. ipv4:
  54. enabled: true
  55. address:
  56. - ip: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['address'] }}
  57. prefix-length: 24
  58. dhcp: false
  59. dns-resolver:
  60. config:
  61. server:
  62. - 192.168.50.254
  63. routes:
  64. config:
  65. - destination: 0.0.0.0/0
  66. next-hop-address: 127.0.0.1
  67. next-hop-interface: {{ hostvars[node.name]['ansible_facts']['default_ipv4']['interface'] }}
  68. table-id: 254
  69. {% endfor %}
  70. {% endif %}