aboutsummaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2023-02-08 19:19:09 +0000
committerGravatar GitHub <[email protected]>2023-02-08 19:19:09 +0000
commit22e6d8cdbaa8f1f1f230c26ce36e17f600d2bb07 (patch)
tree8ff29a2d7b6d36c23742659197106f945a57c06f /roles/common/tasks
parentUpdate bootstrap script to use shorturl (#75) (diff)
Add MOTD and sudo lecture roles (#76)
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/main.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index b3f375b..d470030 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -36,3 +36,33 @@
- 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