diff options
Diffstat (limited to 'roles/common')
| -rw-r--r-- | roles/common/handlers/main.yml | 9 | ||||
| -rw-r--r-- | roles/common/tasks/main.yml | 78 | ||||
| -rw-r--r-- | roles/common/templates/etc-hosts.j2 | 7 | ||||
| -rw-r--r-- | roles/common/templates/motd.j2 | 3 | ||||
| -rw-r--r-- | roles/common/templates/sudo_lecture.j2 | 6 |
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 @@ - -[1m [32m"Bee" careful [34m__ - [32mwith sudo! [34m// \ - \\_/ [33m// - [35m''-.._.-''-.._.. [33m-(||)(') - '''[0m |