Skip to content

Commit 5bea9c8

Browse files
Merge pull request #364 from anjia0532/feat/config_options_enhance
feat(rke2): support structured configuration options
2 parents d5b7301 + f606b1b commit 5bea9c8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

templates/config.yaml.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,24 @@ profile: {{ rke2_cis_profile }}
5656
{%endif%}
5757
{% if rke2_server_options is defined and inventory_hostname in groups[rke2_servers_group_name] %}
5858
{% for option in rke2_server_options %}
59+
{% if option is mapping %}
60+
{% for key, value in option.items() %}
61+
{{ key }}: {{ value }}
62+
{% endfor %}
63+
{% else %}
5964
{{ option }}
65+
{% endif %}
6066
{% endfor %}
6167
{% endif %}
6268
{% if rke2_agent_options is defined and inventory_hostname in groups[rke2_agents_group_name] | default([]) %}
6369
{% for option in rke2_agent_options %}
70+
{% if option is mapping %}
71+
{% for key, value in option.items() %}
72+
{{ key }}: {{ value }}
73+
{% endfor %}
74+
{% else %}
6475
{{ option }}
76+
{% endif %}
6577
{% endfor %}
6678
{% endif %}
6779
{% if ( rke2_kube_controller_manager_arg is defined ) %}

templates/rke2_environment.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{% for option in rke2_environment_options %}
2+
{% if option is mapping %}
3+
{% for key, value in option.items() %}
4+
{{ key }}: {{ value }}
5+
{% endfor %}
6+
{% else %}
27
{{ option }}
8+
{% endif %}
39
{% endfor %}

0 commit comments

Comments
 (0)