fixed linter warnings

This commit is contained in:
nd 2019-11-02 16:21:45 +01:00
parent 5f215c1e34
commit 2e89f83191
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9

View file

@ -1,44 +1,44 @@
--- ---
- name: copy sshd config - name: copy sshd config
template: template:
src: ssh_sshd_config.j2 src: ssh_sshd_config.j2
dest: "{{ rootpath }}/etc/ssh/sshd_config" dest: "{{ rootpath }}/etc/ssh/sshd_config"
owner: root owner: root
mode: 0644 mode: 0644
register: ssh_config register: ssh_config
- name: copy ssh config - name: copy ssh config
template: template:
src: ssh_config.j2 src: ssh_config.j2
dest: "{{ rootpath }}/etc/ssh/ssh_config" dest: "{{ rootpath }}/etc/ssh/ssh_config"
owner: root owner: root
mode: 0644 mode: 0644
- name: create ssh folder for user root - name: create ssh folder for user root
file: file:
path: "{{ rootpath }}/root/.ssh" path: "{{ rootpath }}/root/.ssh"
state: directory state: directory
owner: root owner: root
group: "{{root_group}}" group: "{{ root_group }}"
mode: 0700 mode: 0700
- name: write authorized_keys file for user root - name: write authorized_keys file for user root
template: template:
src: ssh_root_authorized_keys.j2 src: ssh_root_authorized_keys.j2
dest: "{{ rootpath }}/root/.ssh/authorized_keys" dest: "{{ rootpath }}/root/.ssh/authorized_keys"
owner: root owner: root
group: "{{root_group}}" group: "{{ root_group }}"
mode: 0600 mode: 0600
when: admin_ssh_keys | length when: admin_ssh_keys | length
- name: create ssh host keys - name: create ssh host keys
shell: "prefix=\"{{ rootpath }}\"; ssh-keygen -N \"\" -t ed25519 -f \"${prefix}/etc/ssh/ssh_host_ed25519_key\"; ssh-keygen -N \"\" -b 4096 -t rsa -f \"${prefix}/etc/ssh/ssh_host_rsa_key\"; ssh-keygen -N \"\" -b 521 -t ecdsa -f \"${prefix}/etc/ssh/ssh_host_ecdsa_key\"" shell: "prefix=\"{{ rootpath }}\"; ssh-keygen -N \"\" -t ed25519 -f \"${prefix}/etc/ssh/ssh_host_ed25519_key\"; ssh-keygen -N \"\" -b 4096 -t rsa -f \"${prefix}/etc/ssh/ssh_host_rsa_key\"; ssh-keygen -N \"\" -b 521 -t ecdsa -f \"${prefix}/etc/ssh/ssh_host_ecdsa_key\""
args: args:
creates: "{{ rootpath }}/etc/ssh/ssh_host_ed25519_key" creates: "{{ rootpath }}/etc/ssh/ssh_host_ed25519_key"
register: ssh_hostkeys register: ssh_hostkeys
- name: maybe restart sshd - name: maybe restart sshd
meta: noop meta: noop
changed_when: (ssh_hostkeys|changed or ssh_config|changed) and not rootpath == '' changed_when: ( (ssh_hostkeys is changed) or (ssh_config is changed) ) and not rootpath
notify: notify:
- restart sshd - restart sshd