blob: 8cf09ec5c666c4342aecea08d13b30d49621b4ce (
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
|
- hosts: image
tasks:
- shell: |
echo "{{ host }}" > /etc/hostname
sed -i '/^127\.0\.0.*localhost.*/s/.*/127.0.0.1 localhost {{ host }}/' \
/etc/hosts
sed -i '/^root:[^:]:/s//root::/' /etc/passwd
- copy:
content: |
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
dest: /etc/network/interfaces
- apt:
name:
- build-essential
- cargo
- graphviz
- librsvg2-bin
- locales-all
- pandoc
- pandoc-citeproc
- plantuml
- texlive-fonts-recommended
- texlive-latex-base
- texlive-latex-recommended
- user:
comment: "Worker"
name: worker
shell: /bin/bash
- file:
state: directory
path: /home/worker/.ssh
owner: worker
group: worker
mode: 0700
- copy:
src: manager.key.pub
dest: /home/worker/.ssh/authorized_keys
owner: worker
group: worker
mode: 0600
- copy:
content: |
worker ALL=(ALL:ALL) NOPASSWD: ALL
dest: /etc/sudoers.d/worker
owner: root
group: root
mode: 0600
vars:
host: worker
ansible_python_interpreter: /usr/bin/python3
|