diff --git a/tasks/main.yml b/tasks/main.yml index e17042c..2602944 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,7 +9,7 @@ shell: /bin/bash groups: "{{ group }},ssh_access" password: "{{lookup('password', 'cred.' + item + '.pass chars=ascii_letters,digits,hexdigitsi length=15') | password_hash('sha512')}}" - with_items: "{{userlist}}" + loop: "{{userlist}}" - name: Add user to sudoers lineinfile: @@ -18,16 +18,16 @@ line: "{{ item }} ALL=(ALL) NOPASSWD: ALL" mode: 0440 when: sudoers - with_items: "{{userlist}}" + loop: "{{userlist}}" - name: Display generated password debug: msg: "Generated password for {{item}}: {{lookup('password', 'cred.' + item + '.pass chars=ascii_letters,digits,hexdigitsi length=15')}}" - with_items: "{{userlist}}" + loop: "{{userlist}}" - name: Remove password files created by ansible file: path: cred.{{item}}.pass state: absent - with_items: "{{userlist}}" + loop: "{{userlist}}"