This commit is contained in:
2022-02-21 01:29:16 +01:00
parent 1c57c66dca
commit 3a23a7cee5
8 changed files with 1560 additions and 103 deletions

View File

@ -1,48 +0,0 @@
---
- name: Ensure remote users for ansible exists
user:
name: '{{ item.name }}'
state: present
uid: '{{ item.user_id | default(omit) }}'
#group: '{{ item.name | default(omit) }}'
shell: '{{ item.shell|d("/bin/bash") }}'
password: "{{ item.password }}"
update_password: on_create
with_items: '{{ ansible_remote_user }}'
loop_control:
label: ' user "{{ item.name }}" exists'
tags:
- ansible-remote-user
- name: Ensure ansible user is part of sudo group
user:
name: "{{ item.name }}"
groups: sudo
append: yes
with_items: "{{ ansible_remote_user }}"
loop_control:
label: ' user "{{ item.name }}" is part of sudo group'
tags:
- sudo-users
- name: Ensure authorized_key files are present for ansible user
authorized_key:
user: "{{ item.name }}"
key: "{{ ssh_keys_admin|join('\n') }}"
state: present
with_items:
- '{{ ansible_remote_user }}'
loop_control:
label: ' authorized_key of user "{{ item.name }}" is present'
tags:
- authorized_key
- name: Ensure authorized_key files are present for user root
authorized_key:
user: root
key: "{{ ssh_keys_admin|join('\n') }}"
state: present
tags:
- authorized_key

View File

@ -31,9 +31,9 @@ SystemGroup lpadmin
#ConfigFilePerm 0640
#LogFilePerm 00640
< # Specifies the group name or ID that will be used for log files.
< # The default group in Debian is "adm".
< LogFileGroup adm
# Specifies the group name or ID that will be used for log files.
# The default group in Debian is "adm".
LogFileGroup adm
# Location of the file logging all access to the scheduler; may be the name
# "syslog". If not an absolute path, the value of ServerRoot is used as the