Fix new ansible-lint errors

Quite a few changes here, hopefully they work!
This commit is contained in:
Jake Howard
2023-06-15 15:16:19 +01:00
parent 2a0d40aca9
commit 2af9f8529d
27 changed files with 52 additions and 47 deletions

View File

@ -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

View File

@ -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:

View File

@ -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