feat: make fixes to be compatible with latest version (#5)
All checks were successful
checks-test / Lint (push) Successful in 16s
checks-test / molecule (debian11) (push) Successful in 2m11s
checks-test / molecule (debian13) (push) Successful in 2m21s
checks-test / molecule (rockylinux10) (push) Successful in 2m19s
checks-test / molecule (debian12) (push) Successful in 2m43s
checks-test / molecule (rockylinux9) (push) Successful in 1m55s
checks-test / molecule (ubuntu2204) (push) Successful in 1m47s
checks-test / molecule (ubuntu2404) (push) Successful in 1m54s
All checks were successful
checks-test / Lint (push) Successful in 16s
checks-test / molecule (debian11) (push) Successful in 2m11s
checks-test / molecule (debian13) (push) Successful in 2m21s
checks-test / molecule (rockylinux10) (push) Successful in 2m19s
checks-test / molecule (debian12) (push) Successful in 2m43s
checks-test / molecule (rockylinux9) (push) Successful in 1m55s
checks-test / molecule (ubuntu2204) (push) Successful in 1m47s
checks-test / molecule (ubuntu2404) (push) Successful in 1m54s
Reviewed-on: #5 Co-authored-by: Mykhailo Nikiforov <mn@palkoi.net> Co-committed-by: Mykhailo Nikiforov <mn@palkoi.net>
This commit was merged in pull request #5.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: Create users
|
||||
ansible.builtin.include_tasks: user.yml
|
||||
when: ansible_default_ipv4.address in users[username]['passwords'] or users[username]['passwords'].get('default')
|
||||
when: ansible_default_ipv4.address in users[username]['passwords'] or users[username]['passwords'].get('default', '') != ''
|
||||
with_items: "{{ users.keys() }}"
|
||||
loop_control:
|
||||
loop_var: username
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
ansible.builtin.user:
|
||||
name: "{{ username }}"
|
||||
password: "{{ users[username]['passwords'].get(ansible_default_ipv4.address) }}"
|
||||
when: "ansible_default_ipv4.address in users[username]['passwords'] and
|
||||
users[username]['passwords'].get(ansible_default_ipv4.address) != 'default'"
|
||||
when: "ansible_facts['default_ipv4'].address in users[username]['passwords'] and
|
||||
users[username]['passwords'].get(ansible_facts['default_ipv4'].address) != 'default'"
|
||||
|
||||
- name: "Set default password for user `{{ username }}`"
|
||||
ansible.builtin.user:
|
||||
name: "{{ username }}"
|
||||
password: "{{ users[username]['passwords'].get('default') }}"
|
||||
when: "ansible_default_ipv4.address not in users[username]['passwords'] or
|
||||
users[username]['passwords'].get(ansible_default_ipv4.address) == 'default'"
|
||||
when: "ansible_facts['default_ipv4'].address not in users[username]['passwords'] or
|
||||
users[username]['passwords'].get(ansible_facts['default_ipv4'].address) == 'default'"
|
||||
|
||||
- name: "Setup ssh key for user `{{ username }}`"
|
||||
ansible.posix.authorized_key:
|
||||
|
||||
Reference in New Issue
Block a user