2 # file: roles/user_add/tasks/main.yaml
4 - name: Conf - Add User
6 append: "{{ item.append | default(omit) }}"
7 createhome: "{{ 'yes' if users_create_homedirs else 'no' }}"
8 generate_ssh_key: "{{ item.generate_ssh_key | default(omit) }}"
9 groups: "{{ item.groups | join(',') if 'groups' in item else '' }}"
10 name: "{{ item.username }}"
11 password: "{{ item.password if item.password is defined else '!' }}"
12 shell: "{{ item.shell if item.shell is defined else users_shell }}"
14 with_items: "{{ users }}"
18 - name: Conf - SSH keys
20 user: "{{ item.0.username }}"
29 - name: Conf - Disable Password Login
31 dest: "/etc/ssh/sshd_config"
32 regexp: "^PasswordAuthentication yes"
33 line: "PasswordAuthentication no"
37 - sshd_disable_password_login