Skip to content

Commit ebc2249

Browse files
committed
Merge branch 'feature/crt_passphrase_check' of github.com:NETWAYS/ansible-collection-elasticstack into feature/crt_passphrase_check
2 parents 7f7ce15 + c01a203 commit ebc2249

File tree

48 files changed

+434
-404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+434
-404
lines changed

.github/workflows/test_full_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
strategy:
3333
fail-fast: false
34-
max-parallel: 4
34+
max-parallel: 2
3535
matrix:
3636
distro:
3737
- rockylinux8

.github/workflows/test_roles_pr.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ on:
3030
- 'roles/**'
3131
- '.github/workflows/test_roles_pr.yml'
3232
- 'molecule/elasticstack_default/**'
33+
merge_group:
3334

3435
jobs:
3536
lint_full:
@@ -47,11 +48,11 @@ jobs:
4748

4849
strategy:
4950
fail-fast: false
50-
max-parallel: 4
51+
max-parallel: 2
5152
matrix:
5253
distro:
53-
- ubuntu2204
5454
- rockylinux8
55+
- ubuntu2204
5556
scenario:
5657
- elasticstack_default
5758
release:

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,34 @@ collections:
3535

3636
You will need the following Ansible collections installed
3737

38-
* community.general (probably already present)
38+
* `community.general` (probably already present)
39+
40+
You will need these packages / libraries installed. Some very basic packages like `openssl` get handled by the collection if needed. The following list contains packages and libraries which only apply to special cases or need for you to decide on the installation method.
41+
42+
* `passlib` Python library if you do not disable password hashing for logstash user and you want to use logstash role from this collection. It should be installed with pip on the Ansible controller.
3943

4044
You may want the following Ansible roles installed. There other ways to achieve what they are doing but using them is easy and convenient.
4145

42-
* geerlingguy.redis
43-
* openssl if you want to use Elastic Security
46+
* `geerlingguy.redis` if you want to use logstash role
4447

4548
### Supported systems
4649

4750
We test the collection on the following Linux distributions. Each one with Elastic Stack 7 and 8.
4851

52+
* Rocky Linux 9
4953
* Rocky Linux 8
50-
* Ubuntu 20.04 LTS
5154
* Ubuntu 22.04 LTS
55+
* Ubuntu 20.04 LTS
5256
* Debian 11
57+
* Debian 10
58+
* CentOS 8
5359

5460
We know from personal experience, that the collections work in following combinations. Missing tests mostly come from incompatibilties between the distribution and our testing environment, not from problems with the collection itself.
5561

5662
* CentOS 7 - Elastic Stack 7
5763

5864
### Known Issues
5965

60-
There are known issues with the following Linux distributions.
61-
62-
* Rocky Linux 9: The GnuPG key used by Elastic seems to be incompatible with this version of Rocky.
6366

6467
## Usage
6568

@@ -69,6 +72,8 @@ Make sure all hosts that should be configured are part of your playbook. (See be
6972

7073
You will want to have reliable DNS resolution or enter all hosts of the stack into your systems hosts files.
7174

75+
The variable `elasticstack_no_log` can be set to `false` if you want to see the output of all tasks. It defaults to `true` because some tasks could reveal passwords in production.
76+
7277
### Versioning
7378

7479
*elasticstack_version*: Version number of tools to install. Only set if you don't want the latest. (default: none).

docs/role-beats.md

-2
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

-5
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

+1-5
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

@@ -18,6 +13,7 @@ Role Variables
1813
* *kibana_tls*: Whether to offer `https` for clients or not (default: `false`)
1914
* *kibana_tls_cert*: Path to the certificate Kibana should show to its clients (default: `/etc/kibana/certs/cert.pem`)
2015
* *kibana_tls_key*: Path to the key Kibana should use when communicating with clients (default: `/etc/kibana/certs/key.pem`)
16+
* *kibana_extra_config*: You can add arbitraty configuration options with this option. Just start it with `|-` and indent the following lines. So you can add as many lines and options to `kibana.yml` as you like. (default: none)
2117

2218
* *kibana_security*: Activate TLS and authentication when connecting to Elasticsearch. **Note**: Only works when `elasticstack_full_stack` is enabled. (default: `true`)
2319

docs/role-logstash.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ Requirements
1919
------------
2020

2121
* `community.general` collection
22-
* `cryptography` >= 2.5
22+
23+
You will need these packages / libraries installed. Some very basic packages like `openssl` get handled by the collection if needed. The following list contains packages and libraries which only apply to special cases or need for you to decide on the installation method.
24+
25+
* `passlib` Python library if you do not disable password hashing for logstash user. It should be installed with pip on the Ansible controller.
2326

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

@@ -67,6 +70,9 @@ Aside from `logstash.yml` we can manage Logstashs pipelines.
6770
* *logstash_security*: Enable X-Security (No default set, but will be activated when in full stack mode)
6871
* *logstash_user*: Name of the user to connect to Elasticsearch (Default: `logstash_writer`)
6972
* *logstash_password_hash*: Generate and use a hash from your `logstash_password` (default: `true`)
73+
* *logstash_password_hash_algorithm*: Password hashing algorithms. Value must be same as `xpack.security.authc.password_hashing.algorithm` (default: `bcrypt`)
74+
* *logstash_password_salt_length*: base64 encoded Salt character lenght. This value must be integer and must be compatible to the selected password hashing algorithms (default: `22`)
75+
* *logstash_password_hash_salt_seed*: A seed to generate random but idempotent salt on the elasticstack ca host. The salt will be used to create idempotent logstash hashed user password (default: `SeedChangeMe`)
7076
* *logstash_password*: Password of Elasticsearch user. It must be at least 6 characters long (default: `password`)
7177
* *logstash_user_indices*: Indices the user has access to (default: `'"ecs-logstash*", "logstash*", "logs*"'`)
7278
* *logstash_reset_writer_role*: Reset user and role with every run: (default: `true`)

molecule/beats_default/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
elasticsearch_jna_workaround: true
1313
elasticsearch_disable_systemcallfilterchecks: true
1414
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
15+
elasticstack_no_log: false
1516
tasks:
1617
- name: Include Elastics repos role
1718
ansible.builtin.include_role:

molecule/beats_peculiar/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
elasticsearch_jna_workaround: true
2222
elasticsearch_disable_systemcallfilterchecks: true
2323
elasticstack_full_stack: false
24+
elasticstack_no_log: false
2425
beats_filebeat_mysql_slowlog_input: true
2526
beats_auditbeat: true
2627
beats_auditbeat_output: logstash

molecule/elasticsearch_cluster-oss/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
elasticsearch_disable_systemcallfilterchecks: true
1212
elasticstack_release: 7
1313
elasticsearch_heap: "1"
14+
elasticstack_no_log: false
1415
tasks:
1516
- name: Include Elastics repos role
1617
ansible.builtin.include_role:

molecule/elasticsearch_cluster-oss/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/elasticsearch_default/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/elasticsearch_no-security/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
elasticsearch_disable_systemcallfilterchecks: true
1313
elasticsearch_heap: "1"
1414
elasticstack_release: 7
15+
elasticstack_no_log: false
1516
tasks:
1617
- name: Include Elastics repos role
1718
ansible.builtin.include_role:

molecule/elasticsearch_no-security/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/elasticsearch_roles_calculation/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- data
1515
elasticsearch_heap: 1
1616
elasticsearch_check_calculation: true
17+
elasticstack_no_log: false
1718
tasks:
1819
- name: Include Elastics repos role
1920
ansible.builtin.include_role:

molecule/elasticsearch_roles_calculation/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/elasticstack_default/converge.yml

+12-18
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,23 @@
1313
elasticsearch_jna_workaround: true
1414
elasticsearch_disable_systemcallfilterchecks: true
1515
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
16-
elasticsearch_heap: "2"
16+
elasticsearch_heap: "1"
1717
elasticstack_full_stack: true
18+
elasticstack_no_log: false
1819
logstash_pipeline_unsafe_shutdown: true
19-
logstash_password_hash: false
2020
beats_filebeat_syslog_udp: true
2121
beats_filebeat_syslog_tcp: true
2222
beats_filebeat_modules:
2323
- system
2424
beats_fields:
2525
- "testbed: molecule"
26+
kibana_extra_config: |-
27+
ops.interval: 5000
2628
tasks:
2729
- name: Enable Elastic installation on RHEL 9
2830
ansible.builtin.set_fact:
2931
elasticstack_rpm_workaround: true
3032
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version >= "9"
31-
- name: Update apt cache.
32-
ansible.builtin.apt:
33-
update_cache: yes
34-
cache_valid_time: 600
35-
changed_when: false
36-
when: ansible_os_family == 'Debian'
37-
- name: Install dependencies
38-
ansible.builtin.package:
39-
name:
40-
- curl
4133
- name: Include Redis
4234
ansible.builtin.include_role:
4335
name: geerlingguy.redis
@@ -50,12 +42,20 @@
5042
- name: Include logstash
5143
ansible.builtin.include_role:
5244
name: logstash
45+
- name: Include kibana
46+
ansible.builtin.include_role:
47+
name: kibana
5348
- name: Include Beats
5449
ansible.builtin.include_role:
5550
name: beats
5651
- name: Install rsyslog
5752
ansible.builtin.package:
5853
name: rsyslog
54+
- name: Remove cache # noqa: risky-shell-pipe
55+
ansible.builtin.shell: >
56+
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
57+
rm -rf /var/cache/*
58+
changed_when: false
5959
- name: Configure rsyslog
6060
ansible.builtin.lineinfile:
6161
line: "*.* @@localhost:514"
@@ -64,9 +64,3 @@
6464
ansible.builtin.service:
6565
name: rsyslog
6666
state: started
67-
- name: Include kibana
68-
ansible.builtin.include_role:
69-
name: kibana
70-
- name: Include Beats
71-
ansible.builtin.include_role:
72-
name: beats

molecule/elasticstack_default/molecule.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:
7-
- name: elasticstack-cluster1
9+
- name: "elasticstack${ELASTIC_RELEASE}-cluster1-${MOLECULE_DISTRO}"
810
groups:
911
- beats
1012
- logstash
@@ -17,7 +19,7 @@ platforms:
1719
cgroupns_mode: host
1820
privileged: true
1921
pre_build_image: true
20-
- name: elasticstack-cluster2
22+
- name: "elasticstack${ELASTIC_RELEASE}-cluster2-${MOLECULE_DISTRO}"
2123
groups:
2224
- beats
2325
- logstash

molecule/kibana_default/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
vars:
99
elasticstack_full_stack: false
1010
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
11+
elasticstack_no_log: false
1112
collections:
1213
- netways.elasticstack
1314
tasks:

molecule/logstash_full_stack-oss/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
beats_filebeat_syslog_tcp: true
2424
logstash_beats_tls: false
2525
elasticstack_release: 7
26+
elasticstack_no_log: false
2627
tasks:
2728
- name: "Include Elastics repos role"
2829
ansible.builtin.include_role:

molecule/logstash_full_stack-oss/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/logstash_pipelines/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
logstash_pipeline_unsafe_shutdown: true
3333
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
3434
elasticstack_full_stack: false
35+
elasticstack_no_log: false
3536
tasks:
3637
- name: "Include Elastics repos role"
3738
ansible.builtin.include_role:

molecule/logstash_pipelines/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/logstash_specific_version/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
logstash_pipeline_unsafe_shutdown: true
1616
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1717
elasticstack_full_stack: false
18+
elasticstack_no_log: false
1819
tasks:
1920

2021
- name: Set Filebeat version for 7.x

molecule/logstash_specific_version/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

molecule/repos_default/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
elasticstack_rpm_workaround: true
88
elasticstack_full_stack: false
99
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
10+
elasticstack_no_log: false
1011
tasks:
1112
- name: Include Elastic Repos
1213
ansible.builtin.include_role:

molecule/repos_default/molecule.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
requirements-file: requirements.yml
46
driver:
57
name: docker
68
platforms:

0 commit comments

Comments
 (0)