diff --git a/system/extra/netdata/files/systemd/override.conf b/system/extra/netdata/files/systemd/override.conf new file mode 100644 index 0000000..c85c80b --- /dev/null +++ b/system/extra/netdata/files/systemd/override.conf @@ -0,0 +1,2 @@ +[Service] +ReadOnlyDirectories= diff --git a/system/extra/netdata/tasks/main.yml b/system/extra/netdata/tasks/main.yml index 4e78fd6..5425084 100644 --- a/system/extra/netdata/tasks/main.yml +++ b/system/extra/netdata/tasks/main.yml @@ -14,6 +14,25 @@ when: system_extra_netdata_install_sensors +- name: "create systemd override directory" + ansible.builtin.file: + path: "/etc/systemd/system/netdata.service.d" + state: "directory" + mode: 0755 + +- name: "create override configuration" + ansible.builtin.copy: + src: "./systemd/override.conf" + dest: "/etc/systemd/system/netdata.service.d/override.conf" + mode: 0644 + register: system_extra_netdata_systemd_override + +- name: "systemd user daemon reload" + ansible.builtin.systemd: + daemon_reload: true + when: + system_extra_netdata_systemd_override.changed + - name: "enable netdata" ansible.builtin.systemd: name: "netdata" @@ -51,6 +70,7 @@ (system_extra_netdata_install.changed or (system_extra_netdata_lm_sensors_install is defined and system_extra_netdata_lm_sensors_install.changed) or + system_extra_netdata_systemd_override.changed or system_extra_netdata_netdata_conf.changed or system_extra_netdata_stream_conf.changed or system_extra_netdata_health_conf.changed) and