summaryrefslogtreecommitdiff
path: root/roles/sane_debian_system/subplot.md
blob: dc226798d6f784d986c97b1caec24da45dbc00c0 (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
57
58
59
60
61
62
63
64
65
66
# Role `sane_debian_system` – set up a manageable Debian system

This role sets up a Debian system so that it can be managed with
Ansible in a reasonable way.

## Version history

### Version 2

* `sane_debian_hostname` defaults to the inventory hostname. This
  means it's not necessary to set it if the default is sufficient.

## Minimally sane Debian system

~~~scenario
given a host running Debian
when I use role sane_debian_system
and I use variables from sane1.yml
and I run the playbook
then the host has the sudo package installed
and the host has the apt-transport-https package installed
and the host has the locales package installed
and the host has the ntp package installed
and the host has an empty /etc/apt/sources.list.d directory
and the host has hostname saneone
and the host has saneone in /etc/hosts for 127.0.1.1
~~~

~~~{#sane1.yml .file .yaml}
sane_debian_system_version: 2

sane_debian_system_codename: buster
sane_debian_system_hostname: saneone
~~~

## Uses inventory hostname by default

~~~scenario
given a host running Debian
when I use role sane_debian_system
and I use variables from sane-without-hostname.yml
and I run the playbook
then the host has the sudo package installed
and the host has hostname debian-ansible-test
~~~

~~~{#sane-without-hostname.yml .file .yaml}
sane_debian_system_version: 2

sane_debian_system_codename: buster
~~~

## Checks that debian codename is set

~~~scenario
given a host running Debian
when I use role sane_debian_system
and I use variables from sane2.yml
and I try to run the playbook
then the command fails
and stdout contains "sane_debian_system_codename"
~~~

~~~{#sane2.yml .file .yaml}
sane_debian_system_version: 2
~~~