PVE servers need root shell.

This commit is contained in:
Hyperling 2021-02-20 10:03:04 -06:00
parent 037e7fedd2
commit 6c39ed1e1f

View File

@ -40,7 +40,6 @@
create: no create: no
backup: yes backup: yes
loop: loop:
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin no'}
- { "key": '^[\#]?AllowTcpForwarding', "value": 'AllowTcpForwarding no'} - { "key": '^[\#]?AllowTcpForwarding', "value": 'AllowTcpForwarding no'}
- { "key": '^[\#]?ClientAliveCountMax', "value": 'ClientAliveCountMax 2'} - { "key": '^[\#]?ClientAliveCountMax', "value": 'ClientAliveCountMax 2'}
- { "key": '^[\#]?Compression', "value": 'Compression no'} - { "key": '^[\#]?Compression', "value": 'Compression no'}
@ -52,6 +51,18 @@
- { "key": '^[\#]?X11Forwarding', "value": 'X11Forwarding no'} - { "key": '^[\#]?X11Forwarding', "value": 'X11Forwarding no'}
- { "key": '^[\#]?AllowAgentForwarding', "value": 'AllowAgentForwarding no'} - { "key": '^[\#]?AllowAgentForwarding', "value": 'AllowAgentForwarding no'}
- name: General | Software | Services | Configure SSHD
lineinfile:
path: "{{ sshd_config }}"
regexp: '{{ item.key }}'
line: '{{ item.value }} # MANAGED BY ANSIBLE'
state: present
create: no
backup: yes
loop:
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin no'}
when: {{ not(ansible_kernel | select ("pve")) }}
- name: General | Software | Services | Enable SSHD - name: General | Software | Services | Enable SSHD
service: service:
name: "{{ sshd }}" name: "{{ sshd }}"