Thanks for creating a potential fix. The various network-config formats that cloud-init handles don't lend themselves to writing arbitrary configuration values to renderer specific files, in your case, the NTPSERVERARGS is a sysconfig renderer specific value that doesn't have an equivalent in other backends, such as eni (etc/network/interfaces) nor netplan.
To address the bug I think the best option is use cloud-init write_files config module to append the string you're interested in.
There is also the cc_ntp module, which controls enabling ntp service, and configuring
but this would only cover your ntp configuration using a custom template.
#cloud-config
ntp:
enabled: true
config:
template: |
## template:jinja
# My NTP Client config
{% if pools -%}# pools{% endif %}
{% for pool in pools -%}
pool {{pool}} iburst minpoll 3 maxpoll 4
{% endfor %}
{%- if servers %}# servers
{% endif %}
{% for server in servers -%}
server {{server}} iburst
{% endfor %}
Hi Manual,
Thanks for creating a potential fix. The various network-config formats that cloud-init handles don't lend themselves to writing arbitrary configuration values to renderer specific files, in your case, the NTPSERVERARGS is a sysconfig renderer specific value that doesn't have an equivalent in other backends, such as eni (etc/network/ interfaces) nor netplan.
To address the bug I think the best option is use cloud-init write_files config module to append the string you're interested in.
#cloud-config
NTPSERVERARGS= "minpoll 3 maxpoll 3"
RES_OPTIONS= "rotate" network
write_files:
- content: |
path: /etc/sysconfig/
append: true
There is also the cc_ntp module, which controls enabling ntp service, and configuring
but this would only cover your ntp configuration using a custom template.
#cloud-config
ntp:
enabled: true
config:
template: |
## template:jinja
# My NTP Client config
{% if pools -%}# pools{% endif %}
{% for pool in pools -%}
pool {{pool}} iburst minpoll 3 maxpoll 4
{% endfor %}
{%- if servers %}# servers
{% endif %}
{% for server in servers -%}
server {{server}} iburst
{% endfor %}