34 lines
759 B
YAML
34 lines
759 B
YAML
|
#################################################
|
||
|
# DO Community Playbooks: Initial Server Setup
|
||
|
#################################################
|
||
|
---
|
||
|
- hosts: all
|
||
|
become: true
|
||
|
vars_files:
|
||
|
- vars/default.yml
|
||
|
|
||
|
tasks:
|
||
|
|
||
|
# Sudo Group Setup
|
||
|
- name: Make sure we have a 'wheel' group
|
||
|
group:
|
||
|
name: wheel
|
||
|
state: present
|
||
|
|
||
|
- name: Allow 'wheel' group to have passwordless sudo
|
||
|
lineinfile:
|
||
|
path: /etc/sudoers
|
||
|
state: present
|
||
|
regexp: '^%wheel'
|
||
|
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
|
||
|
validate: '/usr/sbin/visudo -cf %s'
|
||
|
|
||
|
|
||
|
# Install Packages
|
||
|
- name: Update apt
|
||
|
apt: update_cache=yes
|
||
|
|
||
|
- name: Install required system packages
|
||
|
apt: name={{ sys_packages }} state=latest
|
||
|
|