diff options
| author | 2022-01-10 16:43:35 +0000 | |
|---|---|---|
| committer | 2022-01-10 16:43:35 +0000 | |
| commit | 913675699e867f1249d747c8e2275edc35462b39 (patch) | |
| tree | dd2c3b1315933897756671c0610acfc310b5f112 /roles/common/tasks | |
| parent | Add Ansible inventory (diff) | |
| parent | Add common role for configuring hostnames and SSH (diff) | |
Merge pull request #1 from python-discord/jb3/common-role
Diffstat (limited to 'roles/common/tasks')
| -rw-r--r-- | roles/common/tasks/main.yml | 29 |
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 |