Update to 2021-12-13 22:00

This commit is contained in:
Daniel Berteaud 2021-12-13 22:00:37 +01:00
parent e43d9bc96c
commit 48a37b3126
5 changed files with 20 additions and 15 deletions

View File

@ -50,7 +50,7 @@
- name: Create private dir for Authorized keys
file: path=/etc/ssh/authorized_keys/{{ item.name }} state=directory mode=700 owner={{ item.name }}
ignore_errors: True # Needed eg, if LDAP isn't available on first run
loop: "{{ ssh_users }}"
loop: "{{ ssh_users | rejectattr('keys_file', 'defined') | list }}"
tags: ssh
- name: Deploy ssh user keys
@ -73,7 +73,7 @@
owner: "{{ item.name }}"
when: item.ssh_keys is defined
ignore_errors: True
loop: "{{ ssh_users }}"
loop: "{{ ssh_users | rejectattr('keys_file', 'defined') | list }}"
tags: ssh
- name: Deploy sudo fragment

View File

@ -1,4 +1,11 @@
---
- include_vars: "{{ item }}"
with_first_found:
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
tags: ssh
- name: Combine SSH users
set_fact:

View File

@ -1,17 +1,5 @@
---
- name: Install ssh components
yum:
name:
- openssh-server
- openssh-clients
when: ansible_os_family == 'RedHat'
tags: ssh
- name: Install ssh components
apt:
name:
- openssh-server
- openssh-client
when: ansible_os_family == 'Debian'
package: name={{ ssh_packages }}
tags: ssh

View File

@ -0,0 +1,5 @@
---
ssh_packages:
- openssh-server
- openssh-client

View File

@ -0,0 +1,5 @@
---
ssh_packages:
- openssh-server
- openssh-clients