blob: b1b5d6030e028a233e5c8c6b45ccc6105a62f153 (
plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
---
- name: Initializing adze.robocracy.org
hosts: adze.robocracy.org
remote_user: root
gather_facts: True
vars_files:
- vars/vault.yml
- vars/robocracy.yml
vars:
- admin_email: "root@robocracy.org"
- main_user_name: bnewbold
- hostname_fqdn: adze.robocracy.org
- mediagoblin_hostname: goblin.bnewbold.net
- cgit_hostname: git.bnewbold.net
- gitolite_hostname: git.bnewbold.net
- mediagoblin_email_sender: goblin@bnewbold.net
- mediagoblin_basedir: /srv/http/goblin.bnewbold.net
roles:
- debian_stretch
- hostname
- common
- nullmailer
- nginx
- git
- mediagoblin
- znc
tasks:
- name: Create main user account
user: name={{main_user_name}} state=present groups=sudo append=yes shell=/bin/bash
- name: Give main user account sudo power
template: src=roles/common/templates/sudoers.j2 dest=/etc/sudoers.d/sudoers owner=root group=root mode=0440 validate='visudo -cf %s'
- name: Install main user authorized SSH keys
authorized_key: user="{{ main_user_name}}" key="{{ item }}"
with_file:
- pubkeys/bnewbold.pub
- name: Install root user authorized SSH keys
authorized_key: user=root key="{{ item }}"
with_file:
- pubkeys/bnewbold.pub
- name: Extra packages for this host
apt: name={{item}} state=installed
with_items:
- socat
- rsyslog
post_tasks:
- name: Sanity check that we have IPv4 connectivity
command: /bin/ping -c 2 mit.edu
- name: Sanity check that we have IPv6 connectivity
command: /bin/ping6 -c 2 mit.edu
- name: Done
shell: echo 'Done!'
|