Newer
Older
---
- hosts: all
tasks:
- name: Update APT sources
raw: DEBIAN_FRONTEND=noninteractive apt-get update
changed_when: False
- name: APT install Python
raw: DEBIAN_FRONTEND=noninteractive apt-get install -qy python2.7 python
register: debian_bootstrap_install_python
changed_when: "'Unpacking' in debian_bootstrap_install_python.stdout"
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- name: APT install
apt:
name:
- collectd
- nginx
- openssl
state: present
- name: Collectd facts
collectd_facts:
register: collectd_facts
- name: Assertions
assert:
that:
- collectd_facts is defined
- major in collectd_facts
- collectd_facts.major is number
- collectd_facts.changed == False
- name: Nginx facts
nginx_facts:
register: nginx_facts
- name: Assertions
assert:
that:
- nginx_facts is defined
- version in nginx_facts
- major in nginx_facts
- nginx_facts.major is number
- nginx_facts.changed == False
- name: DH params for missing file
ignore_errors: True
dhparams:
path: /etc/ssl/dhparams.pem
register: missing_dhparams
- name: Assertions
assert:
that:
- missing_dhparams is defined
- bits in missing_dhparams
- missing_dhparams.bits == 0
- failed in missing_dhparams
- missing_dhparams.failed == True
- path in missing_dhparams
- missing_dhparams.path == '/etc/ssl/dhparams.pem'
- name: Generate DH params
command: openssl dhparam -out /etc/ssl/dhparams.pem 2048
changed_when: True
- name: DH params for existing file
dhparams:
path: /etc/ssl/dhparams.pem
register: existing_dhparams
- name: Assertions
assert:
that:
- existing_dhparams is defined
- bits in existing_dhparams
- existing_dhparams.bits == 2048
- failed in existing_dhparams
- existing_dhparams.failed == False
- path in existing_dhparams
- existing_dhparams.path == '/etc/ssl/dhparams.pem'