aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/superusers
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2020-10-25 19:19:28 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2020-10-25 19:19:28 +0100
commita3337c3156c986b0ed64f1cedf3e4d78ef76b92b (patch)
tree5a9f261add57588eaac022a8b1ecf66adc19a0fa /ansible/roles/superusers
parent59f913cc1efa21bd8df1a395d4d20f0b451965c2 (diff)
downloadinfra-a3337c3156c986b0ed64f1cedf3e4d78ef76b92b.tar.gz
infra-a3337c3156c986b0ed64f1cedf3e4d78ef76b92b.tar.bz2
infra-a3337c3156c986b0ed64f1cedf3e4d78ef76b92b.tar.xz
infra-a3337c3156c986b0ed64f1cedf3e4d78ef76b92b.zip
superuser: Fixes from clean machine.
Diffstat (limited to 'ansible/roles/superusers')
-rw-r--r--ansible/roles/superusers/tasks/main.yml16
1 files changed, 11 insertions, 5 deletions
diff --git a/ansible/roles/superusers/tasks/main.yml b/ansible/roles/superusers/tasks/main.yml
index 70623a0..c1f5a47 100644
--- a/ansible/roles/superusers/tasks/main.yml
+++ b/ansible/roles/superusers/tasks/main.yml
@@ -21,11 +21,17 @@
loop_var: group
include_tasks: adjust-group.yml
+- name: mkdir /etc/sudoers.d
+ become: yes
+ file:
+ path: /etc/sudoers.d
+ state: directory
+
- name: "Allow 'sudo' group to have passwordless sudo"
tags: superusers
become: yes
- lineinfile:
- dest: /etc/sudoers
- state: present
- regexp: '^%sudo'
- line: '%sudo ALL=(ALL) NOPASSWD: ALL'
+ copy:
+ dest: /etc/sudoers.d/superusers
+ content: |
+ {{ "Managed by Ansible" | comment }}
+ %sudo ALL=(ALL) NOPASSWD: ALL