aboutsummaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/main.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
new file mode 100644
index 0000000..a83bac5
--- /dev/null
+++ b/roles/common/tasks/main.yml
@@ -0,0 +1,29 @@
+- name: Update hostname to match Ansible inventory
+ hostname:
+ name: "{{ inventory_hostname }}"
+
+- name: Update /etc/hosts to match Ansible inventory
+ template:
+ src: etc-hosts.j2
+ dest: /etc/hosts
+ mode: '0644'
+ owner: root
+ group: root
+
+- name: Disable SSH password authentication
+ lineinfile:
+ dest: /etc/ssh/sshd_config
+ regexp: "^PasswordAuthentication"
+ line: "PasswordAuthentication no"
+ state: present
+ notify:
+ - restart ssh
+
+- name: Set timezone to UTC
+ file:
+ src: /usr/share/zoneinfo/Etc/UTC
+ dest: /etc/localtime
+ mode: '0644'
+ owner: root
+ group: root
+ notify: restart systemd-timesyncd