AWS terraform automation scripts
[csit.git] / resources / tools / testbed-setup / ansible / roles / user_add / tasks / main.yaml
1 ---
2 # file: roles/user_add/tasks/main.yaml
3
4 - name: Add testuser account
5   user:
6     name: "testuser"
7     state: present
8     shell: "/bin/bash"
9     password: "{{ user_pass }}"
10   tags:
11     - add-user
12
13 - name: Allow password login
14   lineinfile:
15     dest: "/etc/ssh/sshd_config"
16     regexp: "^PasswordAuthentication no"
17     line: "PasswordAuthentication yes"
18   notify:
19     - "Restart sshd"
20   tags:
21     - allow-password-login
22
23 - name: Add visudo entry
24   lineinfile:
25     dest: "/etc/sudoers"
26     state: present
27     line: "testuser ALL=(ALL) NOPASSWD: ALL"
28     validate: "visudo -cf %s"
29   tags:
30     - allow-sudo
31