xoxys.users/tasks/main.yml
Robert Kaussow e6a70d69c5
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
refctor: rework ci to ue ansible-lint and fix molecule
2024-08-19 16:06:19 +02:00

37 lines
1.0 KiB
YAML

---
- name: Include OS specific vars
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_lsb.id | default('') | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "vars"
errors: "ignore"
- 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) }}"
vars:
params:
files:
- "users_{{ ansible_lsb.id | default('') | lower }}.yml"
- "users_{{ ansible_os_family | lower }}.yml"
- "users_default.yml"
paths:
- "tasks"
- 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