Fix new ansible-lint errors
Quite a few changes here, hopefully they work!
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
# Change to a high/odd port if this server is exposed to the internet directly
|
||||
Port {{ ssh_port }}
|
||||
|
||||
AllowUsers {% if hostname_slug in pve_hosts %}{{ user }}@{{ pve_hosts.internal_cidr }}{% endif %} {% if hostname_slug in nebula.clients %}{{ user }}@{{ nebula.cidr }}{% endif %} {{ ssh_extra_allowed_users }}
|
||||
AllowUsers {% if hostname_slug in pve_hosts %}{{ me.user }}@{{ pve_hosts.internal_cidr }}{% endif %} {% if hostname_slug in nebula.clients %}{{ me.user }}@{{ nebula.cidr }}{% endif %} {{ ssh_extra_allowed_users }}
|
||||
|
||||
# Bind to all interfaces (change to specific interface if needed)
|
||||
ListenAddress 0.0.0.0
|
||||
|
@ -21,13 +21,13 @@
|
||||
dest: /etc/ssh/sshd_config
|
||||
validate: /usr/sbin/sshd -t -f %s
|
||||
backup: true
|
||||
mode: 0644
|
||||
mode: "644"
|
||||
become: true
|
||||
register: sshd_config
|
||||
|
||||
- name: Set up authorized keys
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ user }}"
|
||||
user: "{{ me.user }}"
|
||||
state: present
|
||||
key: "{{ lookup('file', item) }}"
|
||||
loop:
|
||||
|
@ -1,15 +1,15 @@
|
||||
- name: Make me
|
||||
user:
|
||||
name: "{{ user }}"
|
||||
home: "{{ home }}"
|
||||
comment: "{{ name }}"
|
||||
name: "{{ me.user }}"
|
||||
home: "{{ me.home }}"
|
||||
comment: "{{ me.name }}"
|
||||
shell: /bin/bash
|
||||
system: true
|
||||
become: true
|
||||
|
||||
- name: Give user sudo access
|
||||
user:
|
||||
name: "{{ user }}"
|
||||
name: "{{ me.user }}"
|
||||
groups: "{{ 'sudo' if ansible_os_family == 'Debian' else 'wheel' }}"
|
||||
append: true
|
||||
become: true
|
||||
|
Reference in New Issue
Block a user