Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions roles/set-hostname/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Set hostname of machine to name specified in ansible inventory
become: true
ansible.builtin.hostname:
Expand All @@ -10,4 +9,4 @@
ansible.builtin.lineinfile:
path: /etc/hosts
regexp: '^127\.0\.0\.1'
line: "127.0.0.1 localhost {{ inventory_hostname }}"
line: "127.0.0.1 localhost {{ inventory_hostname }}"
4 changes: 2 additions & 2 deletions roles/ssh-hardening/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

- name: Disable password based login with SSH
ansible.builtin.lineinfile:
regexp: '^#PasswordAuthentication yes'
regexp: "^#PasswordAuthentication yes"
line: "PasswordAuthentication no"
path: /etc/ssh/sshd_config.d/ssh-hardening.conf
create: true
mode: "0600"

- name: Reload sshd service
ansible.builtin.systemd:
Expand Down