Improve ansible code so that ansibe-lint shows fewer errors
This commit is contained in:
parent
e8ef744f59
commit
f965f4466c
23 changed files with 228 additions and 189 deletions
|
@ -1,5 +1,5 @@
|
|||
- name: Reload sshd
|
||||
systemd:
|
||||
ansible.builtin.systemd:
|
||||
name: sshd
|
||||
state: reloaded
|
||||
when: not run_in_installer|default(false)|bool
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
ansible.builtin.lineinfile:
|
||||
path: /etc/sudoers.d/95-lmn-ansible
|
||||
line: 'ansible ALL=(root) NOPASSWD: ALL'
|
||||
create: True
|
||||
create: true
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0700'
|
||||
|
@ -17,12 +17,13 @@
|
|||
- name: Disable ansible user login
|
||||
ansible.builtin.user:
|
||||
name: ansible
|
||||
password_lock: True
|
||||
password_lock: true
|
||||
|
||||
- name: Limit SSH access to user ansible
|
||||
ansible.builtin.blockinfile:
|
||||
dest: /etc/ssh/sshd_config.d/local.conf
|
||||
create: true
|
||||
mode: '0644'
|
||||
block: |
|
||||
PasswordAuthentication no
|
||||
AllowUsers ansible
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue