Skip to content

Commit

Permalink
Set API tasks explicitly to become false (#1393)
Browse files Browse the repository at this point in the history
Undo some changes of commit 5480ff7 

The community.zabbix.zabbix_host module with the delegate_to parameter should not be executed with "become true" if the role zabbix_agent is applied with "become true".

It is possible that the user executing the ansible script has sudo permission on the remote computer that the zabbix_agent role will be executed on, but does not have sudo permission on the local computer from which the ansible script is initially executed.
  • Loading branch information
emrocha authored Sep 15, 2024
1 parent a60c79b commit 7d7e704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- zabbix_agent Role - Set become parameter explicitly to false for API tasks to run without sudo on the local computer.
3 changes: 3 additions & 0 deletions roles/zabbix_agent/tasks/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
until: zabbix_api_hostgroup_created is succeeded
retries: 10
delegate_to: "{{ zabbix_api_server_host }}"
become: false
tags:
- api

Expand Down Expand Up @@ -43,6 +44,7 @@
until: zabbix_api_host_created is succeeded
retries: 10
delegate_to: "{{ zabbix_api_server_host }}"
become: false
changed_when: false
tags:
- api
Expand All @@ -61,5 +63,6 @@
retries: 10
no_log: "{{ ansible_verbosity < 3 }}"
delegate_to: "{{ zabbix_api_server_host }}"
become: false
tags:
- api

0 comments on commit 7d7e704

Please sign in to comment.