diff --git a/tasks/custom_repositories.yml b/tasks/custom_repositories.yml index 2d4995a..95a149e 100644 --- a/tasks/custom_repositories.yml +++ b/tasks/custom_repositories.yml @@ -9,6 +9,7 @@ when: item.options is defined and item.options['Signed-By'] is defined and item.options['Signed-By'] not in [None, ''] + become: true - name: "Configure custom repositories" vars: @@ -20,5 +21,6 @@ owner: root group: root loop: "{{ manage_repositories_custom_repo }}" + become: true notify: - "debian-based-cache-update" diff --git a/tasks/main_repositories.yml b/tasks/main_repositories.yml index af3e60c..2c800d3 100644 --- a/tasks/main_repositories.yml +++ b/tasks/main_repositories.yml @@ -7,6 +7,7 @@ src: "{{ manage_repositories_sources_list_location }}" register: sources_list_current_content ignore_errors: true + become: true - name: "Convert sources.list current content to string" ansible.builtin.set_fact: @@ -24,6 +25,7 @@ group: root mode: '0644' when: sources_list_current_content_str == '' + become: true - name: "Replace content of /etc/apt/sources.list" ansible.builtin.replace: @@ -31,6 +33,7 @@ regexp: "{{ sources_list_current_content_str | regex_escape }}" replace: "{{ sources_list_new_content }}" when: sources_list_current_content_str != sources_list_new_content + become: true - name: "Configure main repositories into sources.list.d for {{ ansible_distribution|lower }} " ansible.builtin.deb822_repository: @@ -40,5 +43,6 @@ suites: "{{ item.suites | join(' ') }}" components: "{{ item.components }}" loop: "{{ manage_repositories_default_repo }}" + become: true notify: - "debian-based-cache-update"