Skip to content

/etc/sysconfig/network changes not permanent on cloud-init controlled VMs #280

@Klaas-

Description

@Klaas-

Hi,
the timesync role makes this change:

timesync/tasks/main.yml

Lines 235 to 248 in f42c6ab

- name: Update network sysconfig file
lineinfile:
dest: /etc/sysconfig/network
create: true
backup: true
mode: "0644"
regexp: '^PEERNTP='
line: 'PEERNTP=no'
# yamllint disable-line rule:line-length
state: "{{ 'absent' if timesync_dhcp_ntp_servers else 'present' }}" # noqa args[module]
notify: Restart {{ timesync_ntp_provider + 'd' }}
when:
- timesync_mode == 1
- ansible_facts['os_family'] == 'RedHat'

it is changing a file that is created by cloud-init automatically on every boot (in azure at least, not sure about other hyperscalers).

So I guess this is more of a question, should this be part of the role? Should this role deal with cloud-init and not set it on cloud-init enabled systems? Would there be a better place to set this in case of cloud-init control?

Greetings
Klaas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions