Add superuser, sudo group, and sudo group sudoers file.
This commit is contained in:
parent
235d8c304d
commit
47be3301e1
@ -1 +1 @@
|
||||
ansible ALL=(ALL) NOPASSWD: ALL
|
||||
ansible ALL=(ALL) NOPASSWD: ALL
|
1
files/sudoers_sudo
Normal file
1
files/sudoers_sudo
Normal file
@ -0,0 +1 @@
|
||||
%sudo ALL=(ALL) ALL
|
@ -15,8 +15,10 @@
|
||||
|
||||
tasks:
|
||||
- include: tasks/packages.yml
|
||||
- include: tasks/groups.yml
|
||||
- include: tasks/users.yml
|
||||
- include: tasks/cron.yml
|
||||
- include: tasks/sudo.yml
|
||||
- include: tasks/harden.yml
|
||||
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:
|
||||
name: ansible
|
||||
comment: Ansible
|
||||
system: yes
|
||||
|
||||
|
||||
- name: Add Ansible Sudoers File
|
||||
copy:
|
||||
src: sudoers_ansible
|
||||
dest: "{{ sudoers_install_dir }}"
|
||||
owner: root
|
||||
group: "{{ root_group }}"
|
||||
mode: 0440
|
||||
# Superuser
|
||||
- name: Create User Hyperling
|
||||
user:
|
||||
name: ling
|
||||
comment: Hyperling
|
||||
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