diff --git a/changelogs/fragments/agent_become.yml b/changelogs/fragments/agent_become.yml new file mode 100644 index 000000000..a499a4643 --- /dev/null +++ b/changelogs/fragments/agent_become.yml @@ -0,0 +1,2 @@ +bugfixes: + - agent role - Added missing become statement to allow run to role as nonroot diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index fc8669ed0..3e80e7583 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -50,7 +50,8 @@ ansible.builtin.file: path: /etc/apt/keyrings/ state: directory - mode: '0755' + mode: "0755" + become: true when: - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "22") or (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") @@ -59,7 +60,7 @@ ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}" - mode: '0644' + mode: "0644" force: true environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"