aboutsummaryrefslogtreecommitdiffstats
path: root/roles/common
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-08-13 14:59:36 +0100
committerGravatar Chris Lovering <[email protected]>2023-08-13 15:54:03 +0100
commit431585b5256a0d08f4f3c33122465a88a93ddcb1 (patch)
tree4cc41cda81655332fa467e6c9c85d1ee9c35b90e /roles/common
parentServe static files from Turing (#116) (diff)
Move all ansible files to their own folder
Diffstat (limited to 'roles/common')
-rw-r--r--roles/common/handlers/main.yml9
-rw-r--r--roles/common/tasks/main.yml78
-rw-r--r--roles/common/templates/etc-hosts.j27
-rw-r--r--roles/common/templates/motd.j23
-rw-r--r--roles/common/templates/sudo_lecture.j26
5 files changed, 0 insertions, 103 deletions
diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml
deleted file mode 100644
index 02cc88e..0000000
--- a/roles/common/handlers/main.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-- name: Restart ssh
- service:
- name: ssh
- state: restarted
-
-- name: Restart systemd-timesyncd
- service:
- name: systemd-timesyncd
- state: restarted
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
deleted file mode 100644
index b9b9c52..0000000
--- a/roles/common/tasks/main.yml
+++ /dev/null
@@ -1,78 +0,0 @@
-- name: Update hostname to match Ansible inventory
- hostname:
- name: "{{ inventory_hostname }}"
- tags:
- - role::common
-
-- name: Update /etc/hosts to match Ansible inventory
- template:
- src: etc-hosts.j2
- dest: /etc/hosts
- mode: '0644'
- owner: root
- group: root
- tags:
- - role::common
-
-- name: Disable SSH password authentication
- lineinfile:
- dest: /etc/ssh/sshd_config
- regexp: "^PasswordAuthentication"
- line: "PasswordAuthentication no"
- state: present
- notify:
- - Restart ssh
- tags:
- - role::common
-
-- 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
- tags:
- - role::common
-
-- name: Create sudoers lecture
- template:
- src: sudo_lecture.j2
- dest: /etc/sudo_lecture
- mode: '0644'
- owner: root
- group: root
- tags:
- - role::common
-
-- name: Add sudoers lecture path
- lineinfile:
- dest: /etc/sudoers
- regexp: '^Defaults +?lecture_file ?= ?".+?"$'
- line: 'Defaults lecture_file = "/etc/sudo_lecture"'
- state: present
- validate: /usr/sbin/visudo -cf %s
- tags:
- - role::common
-
-- name: Configure MOTD
- template:
- src: motd.j2
- dest: /etc/motd
- mode: '0644'
- owner: root
- group: root
- tags:
- - role::common
-
-- name: Enable default .bashrc for root
- copy:
- src: /etc/skel/.bashrc
- dest: /root/.bashrc
- mode: '0644'
- owner: root
- group: root
- tags:
- - role::common
diff --git a/roles/common/templates/etc-hosts.j2 b/roles/common/templates/etc-hosts.j2
deleted file mode 100644
index 6fdbdaa..0000000
--- a/roles/common/templates/etc-hosts.j2
+++ /dev/null
@@ -1,7 +0,0 @@
-127.0.0.1 localhost
-127.0.1.1 {{ inventory_hostname }}.box.pydis.wtf {{ inventory_hostname }}
-
-::1 localhost ip6-localhost ip6-loopback
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-{{ lookup('dig', ansible_host) }} {{ inventory_hostname }}.box.pydis.wtf {{ inventory_hostname }}
diff --git a/roles/common/templates/motd.j2 b/roles/common/templates/motd.j2
deleted file mode 100644
index ff6cfcd..0000000
--- a/roles/common/templates/motd.j2
+++ /dev/null
@@ -1,3 +0,0 @@
-[[[ To any NSA and FBI agents accessing our servers: please consider ]]]
-[[[ whether defending the US Constitution against all enemies, ]]]
-[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
diff --git a/roles/common/templates/sudo_lecture.j2 b/roles/common/templates/sudo_lecture.j2
deleted file mode 100644
index 1758dd0..0000000
--- a/roles/common/templates/sudo_lecture.j2
+++ /dev/null
@@ -1,6 +0,0 @@
-
- "Bee" careful __
- with sudo! // \
- \\_/ //
- ''-.._.-''-.._.. -(||)(')
- '''