Files
configpolicy/roles/base/tasks/main.yml
Dustin C. Hatch d6fff04985 r/base: Set SSH authorized keys for root
To ensure all machines have the same keys to allow root to log in via
SSH (in case Active Directory is unavailable or something).
2021-10-16 15:39:19 -05:00

33 lines
709 B
YAML

- name: load distribution-specific values
include_vars: '{{ item }}'
with_first_found:
- '{{ ansible_distribution }}.yml'
- defaults.yml
tags:
- always
- name: ensure selinux python bindings are installed
package:
name: '{{ selinux_python_libs }}'
state: present
tags:
- install
- name: ensure root password is set
user:
name: root
password: '{{ root_password_hash }}'
when: root_password_hash is defined
tags:
- root-user
- user
- name: ensure ssh keys are authorized for root login
ansible.posix.authorized_key:
user: root
exclusive: true
key: '{{ root_authorized_keys }}'
when: root_authorized_keys is defined
tags:
- root-user
- ssh-key