Skip to content

Commit c2dc529

Browse files
authored
Install cryptography Python library (#213)
We had this as a requirement. But it makes sense to have the role install the library without any further interaction with the user. fixes #212
1 parent 0c97d25 commit c2dc529

File tree

9 files changed

+30
-22
lines changed

9 files changed

+30
-22
lines changed

docs/role-beats.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Requirements
1010

1111
You need to have the beats you want to install available in your software repositories. We provide a [role](./role-repos.md) for just that but if you have other ways of managing software, just make sure it's available. Alternatively you can install the Beats yourself.
1212

13-
* `cryptography` >= 2.5
1413
* `community.crypto` collection: ansible-galaxy collection install community.crypto
1514

1615
Role Variables
@@ -87,7 +86,6 @@ beats_filebeat_journald_inputs:
8786
* *beats_loglevel*: Level of logging (for all beats) (Default: `info`)
8887
* *beats_logpath*: If logging to file, where to put logfiles (Default: `/var/log/beats`)
8988
* *beats_fields*: Fields that are added to every input in the configuration
90-
* *beats_manage_unzip*: Install `unzip` via package manager (Default: `true`)
9189

9290
The following variables only apply if you use this role together with our other Elastic Stack roles.
9391

docs/role-elasticsearch.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ If you use the role to set up security you, can use its CA to create certificate
99

1010
Please note that setting `elasticsearch_bootstrap_pw` as variable will only take effect when initialising Elasticsearch. Changes after starting elasticsearch for the first time will not change the bootstrap password for the instance and will lead to breaking tests.
1111

12-
Requirements
13-
------------
14-
15-
* `cryptography` >= 2.5
16-
1712
Role Variables
1813
--------------
1914

docs/role-kibana.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ Ansible Role: Kibana
55

66
This roles installs and configures Kibana.
77

8-
Requirements
9-
------------
10-
11-
* `cryptography` >= 2.5
12-
138
Role Variables
149
--------------
1510

docs/role-logstash.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Requirements
1919
------------
2020

2121
* `community.general` collection
22-
* `cryptography` >= 2.5
2322

2423
You need to have the Elastic Repos configured on your system. You can use our [role](./role-repos.md)
2524

roles/beats/defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ elasticstack_beats_port: 5044
1010
beats_logging: file
1111
beats_logpath: /var/log/beats
1212
beats_loglevel: info
13-
beats_manage_unzip: true
1413

1514
# Use TLS without Elastic X-Pack #
1615

roles/beats/tasks/beats-security.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22

3-
- name: Install unzip for certificate handling
3+
- name: Install packages for security tasks
44
ansible.builtin.package:
5-
name: unzip
6-
when: beats_manage_unzip | bool
5+
name:
6+
- unzip
7+
- python3-cryptography
8+
- openssl
79
tags:
10+
- certificates
811
- renew_ca
12+
- renew_kibana_cert
913
- renew_beats_cert
1014

1115
- name: Ensure beats certificate exists

roles/elasticsearch/tasks/elasticsearch-security.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
---
22

3+
- name: Install packages for security tasks
4+
ansible.builtin.package:
5+
name:
6+
- unzip
7+
- python3-cryptography
8+
- openssl
9+
tags:
10+
- certificates
11+
- renew_ca
12+
- renew_kibana_cert
13+
- renew_es_cert
14+
315
- name: Set elasticstack_ca variable if not already done by user
416
ansible.builtin.set_fact:
517
elasticstack_ca: "{{ groups['elasticsearch'][0] }}"

roles/kibana/tasks/kibana-security.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22

3-
- name: Make sure openssl is installed
3+
- name: Install packages for security tasks
44
ansible.builtin.package:
5-
name: openssl
5+
name:
6+
- unzip
7+
- python3-cryptography
8+
- openssl
69
tags:
710
- certificates
811
- renew_ca

roles/logstash/tasks/logstash-security.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22

3-
- name: Install unzip for certificate handling
3+
- name: Install packages for security tasks
44
ansible.builtin.package:
5-
name: unzip
5+
name:
6+
- unzip
7+
- python3-cryptography
8+
- openssl
69
tags:
710
- certificates
811
- renew_ca
@@ -383,7 +386,7 @@
383386

384387
- name: Create logstash password hash salt
385388
ansible.builtin.copy:
386-
content: "{{ lookup('password', '/dev/null', chars=['ascii_lowercase', 'digits'], length=logstash_password_hash_salt_length, seed=logstash_password_hash_salt_seed)}}"
389+
content: "{{ lookup('password', '/dev/null', chars=['ascii_lowercase', 'digits'], length=logstash_password_hash_salt_length, seed=logstash_password_hash_salt_seed) }}"
387390
dest: /root/logstash_password_hash_salt
388391
owner: root
389392
group: root

0 commit comments

Comments
 (0)