-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanu-setup-no-ssh.yml
37 lines (33 loc) · 959 Bytes
/
anu-setup-no-ssh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#################################################
# DO Community Playbooks: Initial Server Setup
#################################################
---
- hosts: "{{ variable_host | default('anu-local') }}"
become: yes
vars_files:
- vars/default.yml
tasks:
# Sudo Group Setup
- name: Make sure we have a 'sudo' group
group:
name: sudo
state: present
# User + Key Setup
- name: Create a new regular user with sudo privileges
user:
name: "{{ user }}"
state: present
groups: sudo, audio
append: true
create_home: true
shell: /bin/bash
update_password: always
password: "{{ password|password_hash('sha512') }}"
- name: Template hosts file
template:
src: templates/system/hosts.j2
dest: /etc/hosts
- name: Template hostname file
template:
src: templates/system/hostname.j2
dest: /etc/hostname