Add superuser, sudo group, and sudo group sudoers file.
This commit is contained in:
parent
235d8c304d
commit
47be3301e1
1
files/sudoers_sudo
Normal file
1
files/sudoers_sudo
Normal file
@ -0,0 +1 @@
|
|||||||
|
%sudo ALL=(ALL) ALL
|
@ -15,8 +15,10 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include: tasks/packages.yml
|
- include: tasks/packages.yml
|
||||||
|
- include: tasks/groups.yml
|
||||||
- include: tasks/users.yml
|
- include: tasks/users.yml
|
||||||
- include: tasks/cron.yml
|
- include: tasks/cron.yml
|
||||||
|
- include: tasks/sudo.yml
|
||||||
- include: tasks/harden.yml
|
- include: tasks/harden.yml
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
6
tasks/groups.yml
Normal file
6
tasks/groups.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
# Groups that do not come to all distros by default.
|
||||||
|
|
||||||
|
- name: Ensure sudo group exists (Looking at you BSD!)
|
||||||
|
group:
|
||||||
|
name: sudo
|
18
tasks/sudo.yml
Normal file
18
tasks/sudo.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
# Ensure the proper users have sudo access.
|
||||||
|
|
||||||
|
- name: Add Ansible Sudoers File
|
||||||
|
copy:
|
||||||
|
src: sudoers_ansible
|
||||||
|
dest: "{{ sudoers_install_dir }}"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: 0440
|
||||||
|
|
||||||
|
- name: Add Sudo Group Sudoers File
|
||||||
|
copy:
|
||||||
|
src: sudoers_sudo
|
||||||
|
dest: "{{ sudoers_install_dir }}"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: 0440
|
@ -1,14 +1,23 @@
|
|||||||
---
|
---
|
||||||
|
# Create users for both desktop and server machines.
|
||||||
|
|
||||||
- name: Create Ansible User
|
# Scheduler
|
||||||
|
- name: Create User Ansible
|
||||||
user:
|
user:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
comment: Ansible
|
||||||
system: yes
|
system: yes
|
||||||
|
|
||||||
- name: Add Ansible Sudoers File
|
|
||||||
copy:
|
# Superuser
|
||||||
src: sudoers_ansible
|
- name: Create User Hyperling
|
||||||
dest: "{{ sudoers_install_dir }}"
|
user:
|
||||||
owner: root
|
name: ling
|
||||||
group: "{{ root_group }}"
|
comment: Hyperling
|
||||||
mode: 0440
|
groups:
|
||||||
|
- sudo
|
||||||
|
append: yes
|
||||||
|
shell: /bin/bash
|
||||||
|
create_home: yes
|
||||||
|
skeleton: yes
|
||||||
|
generate_ssh_key: yes
|
Loading…
x
Reference in New Issue
Block a user