2019-11-03 17:19:53 +00:00
|
|
|
---
|
2024-08-19 14:06:19 +00:00
|
|
|
- name: Include OS specific vars
|
|
|
|
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
2019-11-03 17:19:53 +00:00
|
|
|
vars:
|
|
|
|
params:
|
|
|
|
files:
|
|
|
|
- "{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
|
|
- "{{ ansible_os_family | lower }}.yml"
|
|
|
|
paths:
|
|
|
|
- "vars"
|
|
|
|
errors: "ignore"
|
2024-08-19 14:06:19 +00:00
|
|
|
- name: Ensure secure defaults
|
|
|
|
ansible.builtin.include_tasks: security.yml
|
|
|
|
- name: Configure bash
|
|
|
|
ansible.builtin.include_tasks: bash.yml
|
|
|
|
- name: Configure users
|
|
|
|
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
|
2019-11-03 17:19:53 +00:00
|
|
|
vars:
|
|
|
|
params:
|
|
|
|
files:
|
|
|
|
- "users_{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
|
|
- "users_{{ ansible_os_family | lower }}.yml"
|
|
|
|
- "users_default.yml"
|
|
|
|
paths:
|
|
|
|
- "tasks"
|
2024-08-19 14:06:19 +00:00
|
|
|
|
|
|
|
- name: Set authorized_key for ssh users
|
|
|
|
ansible.posix.authorized_key:
|
|
|
|
user: "{{ item.name }}"
|
|
|
|
key: "{{ item.sshkeys }}"
|
|
|
|
exclusive: True
|
|
|
|
state: present
|
|
|
|
loop: "{{ users_default_users }}"
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.name }}"
|
|
|
|
when: item.sshkeys is defined
|