Fix invalid variable naming for user role
According to the linter variables used within rules should start with the role's prefix.
This commit is contained in:
parent
6c0425418e
commit
22376928e2
3 changed files with 8 additions and 8 deletions
|
|
@ -8,8 +8,8 @@
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: user
|
name: user
|
||||||
vars:
|
vars:
|
||||||
username: "{{ actual_user }}"
|
user_username: "{{ actual_user }}"
|
||||||
password: "{{ actual_password }}"
|
user_password: "{{ actual_password }}"
|
||||||
- name: Create a directory for holding actual's (volume) data
|
- name: Create a directory for holding actual's (volume) data
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ actual_user }}"
|
become_user: "{{ actual_user }}"
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: user
|
name: user
|
||||||
vars:
|
vars:
|
||||||
username: "{{ cloudflare_ddns_user }}"
|
user_username: "{{ cloudflare_ddns_user }}"
|
||||||
password: "{{ cloudflare_ddns_user_password }}"
|
user_password: "{{ cloudflare_ddns_user_password }}"
|
||||||
- name: Install Python dependencies # noqa: package-latest
|
- name: Install Python dependencies # noqa: package-latest
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
append: true
|
append: true
|
||||||
groups:
|
groups:
|
||||||
- users
|
- users
|
||||||
name: "{{ username }}"
|
name: "{{ user_username }}"
|
||||||
# Salt is necessary, see: https://stackoverflow.com/questions/56869949/ansible-user-module-always-shows-changed
|
# Salt is necessary, see: https://stackoverflow.com/questions/56869949/ansible-user-module-always-shows-changed
|
||||||
password: "{{ password | password_hash('sha512', password_salt) }}"
|
password: "{{ user_password | password_hash('sha512', password_salt) }}"
|
||||||
when: username is not undefined # Skip when no user is provided, we'll asume we're targetting the Ansible user.
|
when: user_username is not undefined # Skip when no user is provided, we'll asume we're targetting the Ansible user.
|
||||||
- name: Set fact for defining the user which should run the next modules
|
- name: Set fact for defining the user which should run the next modules
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
target_user: "{{ ansible_facts['user_id'] if username is undefined else username }}"
|
target_user: "{{ ansible_facts['user_id'] if user_username is undefined else user_username }}"
|
||||||
- name: Ensuring ZSH is installed # noqa: package-latest
|
- name: Ensuring ZSH is installed # noqa: package-latest
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue