diff --git a/handlers/main.yml b/handlers/main.yml index cb857ac..776cd8a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,8 +6,8 @@ args: chdir: "{{ netbox_current_path }}/netbox" executable: /bin/bash - become: yes - become_method: sudo + become: true + become_method: ansible.builtin.sudo become_user: "{{ netbox_user }}" listen: restart_netbox register: config_check @@ -17,7 +17,7 @@ ansible.builtin.service: name: "{{ item }}" state: restarted - become: yes + become: true listen: restart_netbox loop: - netbox diff --git a/tasks/superusers.yml b/tasks/superusers.yml index 399d4aa..7bd0908 100644 --- a/tasks/superusers.yml +++ b/tasks/superusers.yml @@ -11,8 +11,8 @@ args: chdir: "{{ netbox_current_path }}/netbox" executable: /bin/bash - become: yes - become_method: sudo + become: true + become_method: ansible.builtin.sudo become_user: "{{ netbox_user }}" register: result loop: "{{ netbox_superusers }}" diff --git a/tasks/upgrade.yml b/tasks/upgrade.yml index 65c5406..6da1915 100644 --- a/tasks/upgrade.yml +++ b/tasks/upgrade.yml @@ -4,7 +4,7 @@ environment: PYTHON: "python{{ python_version | default(__python_version) }}" become: true - become_method: sudo + become_method: ansible.builtin.sudo become_user: "{{ netbox_user }}" notify: restart_netbox # task vs handler to trigger at specific point in run