roles: Fix ansible-lint warning on var-naming.

ansible-lint warns if set_fact sets a variable where the name is used
or can be as a parameter for the role.
This commit is contained in:
Rafael Guterres Jeffman
2023-01-09 20:47:40 -03:00
parent 5062ac2b09
commit 8240d9beb6
4 changed files with 38 additions and 32 deletions

View File

@@ -9,7 +9,7 @@
- name: Set controller destination directory
ansible.builtin.set_fact:
ipabackup_controller_dir:
__derived_controller_dir:
"{{ ipabackup_controller_path | default(lookup('env', 'PWD')) }}/{{
ipabackup_name_prefix | default(ansible_facts['fqdn']) }}_{{
ipabackup_item }}/"
@@ -35,13 +35,13 @@
ansible.builtin.fetch:
flat: yes
src: "{{ ipabackup_dir }}/{{ ipabackup_item }}/{{ item }}"
dest: "{{ ipabackup_controller_dir }}"
dest: "{{ __derived_controller_dir }}"
with_items:
- "{{ result_find_backup_files.stdout_lines }}"
- name: Fix file modes for backup on controller
ansible.builtin.file:
dest: "{{ ipabackup_controller_dir }}"
dest: "{{ __derived_controller_dir }}"
mode: u=rwX,go=
recurse: yes
delegate_to: localhost