Ansible Galaxy Role: Common configuration for Ubuntu instances hosted on Linode
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
580 B

---
- name: add_user | Add admin user
user:
name: "{{ admin_user }}"
group: "{{ admin_group }}"
state: present
create_home: yes
become: yes
- name: add_user | Ensure admin user ssh directory exists
file:
path: "/home/{{ admin_user }}/.ssh/"
state: directory
owner: "{{ admin_user }}"
group: "{{ admin_group }}"
mode: 0700
become: yes
- name: add_user | Add SSH keys to admin user
authorized_key:
user: "{{ admin_user }}"
state: "{{ item.state }}"
key: "{{ item.key }}"
with_items: "{{ authorized_keys }}"
become: yes