update everything to be ad compatible
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -1,10 +1,4 @@
|
||||
---
|
||||
- name: Disable password authentication
|
||||
ansible.builtin.replace:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: 'PasswordAuthentication yes'
|
||||
replace: 'PasswordAuthentication no'
|
||||
|
||||
- name: Disable root authentication
|
||||
ansible.builtin.replace:
|
||||
path: /etc/ssh/sshd_config
|
||||
@ -23,22 +17,6 @@
|
||||
regexp: '#AddressFamily any'
|
||||
replace: 'AddressFamily inet'
|
||||
|
||||
- name: Check if AllowUsers is defined
|
||||
ansible.builtin.lineinfile:
|
||||
state: absent
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "intra.tormakris.dev"
|
||||
check_mode: true
|
||||
changed_when: false
|
||||
register: checkallowusers
|
||||
|
||||
- name: Define AllowUsers if undefined
|
||||
ansible.builtin.lineinfile:
|
||||
state: present
|
||||
path: /etc/ssh/sshd_config
|
||||
line: "AllowUsers tormakris@intra.tormakris.dev ansible@intra.tormakris.dev service-user@intra.tormakris.dev"
|
||||
when: checkallowusers.found == 0
|
||||
|
||||
- name: "Restart sshd"
|
||||
ansible.builtin.service:
|
||||
name: sshd
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Create .ssh directory of root user
|
||||
- name: Create .ssh directory of ansible user
|
||||
ansible.builtin.file:
|
||||
path: /home/ansible@intra.tormakris.dev/.ssh
|
||||
state: directory
|
||||
|
Reference in New Issue
Block a user