|
|
@ -1,10 +1,10 @@ |
|
|
|
--- |
|
|
|
- name: add_user | Add admin group |
|
|
|
- name: linode_preflight | add_user | Add admin group |
|
|
|
group: |
|
|
|
name: "{{ admin_group }}" |
|
|
|
name: "{{ group }}" |
|
|
|
state: present |
|
|
|
|
|
|
|
- name: add_user | Allow 'admin' group to have passwordless sudo |
|
|
|
- name: linode_preflight | add_user | Allow 'admin' group to have passwordless sudo |
|
|
|
lineinfile: |
|
|
|
dest: /etc/sudoers |
|
|
|
state: present |
|
|
@ -13,27 +13,28 @@ |
|
|
|
validate: 'visudo -cf %s' |
|
|
|
become: yes |
|
|
|
|
|
|
|
- name: add_user | Add admin user |
|
|
|
- name: linode_preflight | add_user | Add admin user |
|
|
|
user: |
|
|
|
name: "{{ admin_user }}" |
|
|
|
group: "{{ admin_group }}" |
|
|
|
name: "{{ user }}" |
|
|
|
group: "{{ group }}" |
|
|
|
state: present |
|
|
|
create_home: yes |
|
|
|
shell: /bin/bash |
|
|
|
become: yes |
|
|
|
|
|
|
|
- name: add_user | Ensure admin user ssh directory exists |
|
|
|
- name: linode_preflight | add_user | Ensure admin user ssh directory exists |
|
|
|
file: |
|
|
|
path: "/home/{{ admin_user }}/.ssh/" |
|
|
|
path: "/home/{{ user }}/.ssh/" |
|
|
|
state: directory |
|
|
|
owner: "{{ admin_user }}" |
|
|
|
group: "{{ admin_group }}" |
|
|
|
owner: "{{ user }}" |
|
|
|
group: "{{ group }}" |
|
|
|
mode: 0700 |
|
|
|
become: yes |
|
|
|
|
|
|
|
- name: add_user | Add SSH keys to admin user |
|
|
|
- name: linode_preflight | add_user | Add SSH keys to admin user |
|
|
|
authorized_key: |
|
|
|
user: "{{ admin_user }}" |
|
|
|
user: "{{ user }}" |
|
|
|
state: present |
|
|
|
key: "{{ item.key }}" |
|
|
|
with_items: "{{ ssh_keys }}" |
|
|
|
with_items: "{{ ssh__keys }}" |
|
|
|
become: yes |