Skip to content

Commit 63fda46

Browse files
authored
Merge pull request #5 from NETWAYS/upgradeEL8/changes
Upgrade el8/changes
2 parents c16d416 + 28afe22 commit 63fda46

File tree

48 files changed

+104
-174
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

+104
-174
lines changed

.github/workflows/test_full_stack.yml

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- rockylinux8
3030
scenario:
3131
- elasticstack_default
32+
release:
33+
- 7
34+
- 8
3235

3336
steps:
3437
- name: Check out code
@@ -56,3 +59,4 @@ jobs:
5659
MOLECULE_DISTRO: ${{ matrix.distro }}
5760
PY_COLORS: '1'
5861
ANSIBLE_FORCE_COLOR: '1'
62+
ELASTIC_RELEASE: ${{ matrix.release }}

.github/workflows/test_role_beats.yml

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
matrix:
7272
distro: [debian11, rockylinux8, ubuntu2204]
7373
scenario: [beats_default, beats_full_stack, beats_peculiar]
74+
release: [ 7, 8 ]
7475

7576
steps:
7677
- name: Check out code
@@ -98,3 +99,4 @@ jobs:
9899
MOLECULE_DISTRO: ${{ matrix.distro }}
99100
PY_COLORS: '1'
100101
ANSIBLE_FORCE_COLOR: '1'
102+
ELASTIC_RELEASE: ${{ matrix.release }}

.github/workflows/test_role_elasticsearch.yml

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
matrix:
7272
distro: [ubuntu2204]
7373
scenario: [elasticsearch_default, elasticsearch_cluster, elasticsearch_cluster-oss, elasticsearch_no-security]
74+
release: [7, 8]
7475

7576
steps:
7677
- name: Check out code
@@ -96,5 +97,6 @@ jobs:
9697
molecule test -s ${{ matrix.scenario }}
9798
env:
9899
MOLECULE_DISTRO: ${{ matrix.distro }}
100+
ELASTIC_RELEASE: ${{ matrix.release }}
99101
PY_COLORS: '1'
100102
ANSIBLE_FORCE_COLOR: '1'

.github/workflows/test_role_kibana.yml

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
matrix:
7272
distro: [ubuntu2204]
7373
scenario: [kibana_default, kibana_full_stack, kibana_full_stack-oss]
74+
release: [ 7, 8 ]
7475

7576
steps:
7677
- name: Check out code
@@ -96,3 +97,4 @@ jobs:
9697
molecule test -s ${{ matrix.scenario }}
9798
env:
9899
MOLECULE_DISTRO: ${{ matrix.distro }}
100+
ELASTIC_RELEASE: ${{ matrix.release }}

.github/workflows/test_role_logstash.yml

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
matrix:
7070
distro: [ubuntu2204]
7171
scenario: [logstash_default]
72+
release: [ 7, 8 ]
7273

7374
steps:
7475
- name: Check out code
@@ -96,6 +97,7 @@ jobs:
9697
MOLECULE_DISTRO: ${{ matrix.distro }}
9798
PY_COLORS: '1'
9899
ANSIBLE_FORCE_COLOR: '1'
100+
ELASTIC_RELEASE: ${{ matrix.release }}
99101

100102
molecule_tests:
101103
runs-on: ubuntu-latest
@@ -115,6 +117,7 @@ jobs:
115117
logstash_full_stack-oss,
116118
logstash_specific_version,
117119
logstash_pipelines]
120+
release: [ 7, 8 ]
118121

119122
steps:
120123
- name: Check out code
@@ -142,3 +145,4 @@ jobs:
142145
MOLECULE_DISTRO: ${{ matrix.distro }}
143146
PY_COLORS: '1'
144147
ANSIBLE_FORCE_COLOR: '1'
148+
ELASTIC_RELEASE: ${{ matrix.release }}

.github/workflows/test_role_repos.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ jobs:
7070
matrix:
7171

7272
distro: [centos7, debian10, debian11, rockylinux8, rockylinux9, ubuntu2004, ubuntu2204]
73-
scenario: [repos_default, repos_oss, repos_elastic8]
73+
scenario: [repos_default, repos_oss]
74+
release: [ 7, 8 ]
7475

7576
steps:
7677
- name: Check out code
@@ -97,3 +98,4 @@ jobs:
9798
molecule test -s ${{ matrix.scenario }}
9899
env:
99100
MOLECULE_DISTRO: ${{ matrix.distro }}
101+
ELASTIC_RELEASE: ${{ matrix.release }}

.github/workflows/test_roles_pr.yml

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- kibana_default
2929
- logstash_default
3030
- repos_default
31+
release:
32+
- 7
33+
- 8
3134

3235
steps:
3336
- name: Check out code
@@ -55,3 +58,4 @@ jobs:
5558
MOLECULE_DISTRO: ${{ matrix.distro }}
5659
PY_COLORS: '1'
5760
ANSIBLE_FORCE_COLOR: '1'
61+
ELASTIC_RELEASE: ${{ matrix.release }}

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,32 @@ You may want the following Ansible roles installed. There other ways to achieve
3939

4040
## Usage
4141

42+
### Default Passwords
43+
44+
Default Passwords can be seen during generation, or found later in `/usr/share/elasticsearch/initial_passwords`
45+
46+
To turn off security currently:
47+
`elastic_override_beats_tls: true`
48+
### Redis
49+
50+
0) You need to install the redis role which is maintained by geerlingguy.
51+
52+
```
53+
ansible-galaxy install geerlingguy.redis
54+
```
55+
56+
1) Default: For general Elastic Stack installations using all features use the following. You will need Redis installed and running for the default setup to run. A viable way is using the `geerlingguy.redis` role. (You can install it with `ansible-galaxy install geerlingguy.redis)
57+
58+
2) Specific: For OSS Installation without X-Pack features you can use the following. _Note_ this is only available for version `7.x`.
59+
4260
Our default configuration will collect filesystem logs placed by `rsyslog`. Therefor our example playbook makes sure, `rsyslog` is installed. If you don't want that, please change the configuration of the `beats` module. Without syslog you won't receive any messages with the default configuration.
4361

4462
There are some comments in the Playbook. Either fill them with the correct values (`remote_user`) or consider them as a hint to commonly used options.
4563

4664
_Note_: The roles rely on hardcoded group names for placing services on hosts. Please make sure you have groups named `elasticsearch`, `logstash` and `kibana` in your Ansible inventory. Hosts in these groups will get the respective services. Restricting your plays to the appropriate hosts will not work because the roles interact with hosts from other groups e.g. for certificate generation.
4765

4866
The execution order of the roles is important! (see below)
67+
4968
```
5069
---
5170
- hosts: all
@@ -74,5 +93,4 @@ The execution order of the roles is important! (see below)
7493
- logstash
7594
- kibana
7695
- beats
77-
7896
```

docs/role-elasticsearch.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This role installs manages Elasticsearch on your hosts. Optionally it can config
77

88
If you use the role to set up security you can use its CA to create certificates for Logstash and Kibana, too.
99

10+
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.
11+
1012
Role Variables
1113
--------------
1214

@@ -16,6 +18,7 @@ Role Variables
1618
* *elasticsearch_datapath*: Path where Elasticsearch will store it's data. (default: `/var/lib/elasticsearch` - the packages default)
1719
* *elasticsearch_create_datapath*: Create the path for data to store if it doesn't exist. (default: `false` - only useful if you change `elasticsearch_datapath`)
1820
* *elasticsearch_fs_repo*: List of paths that should be registered as repository for snapshots (only filesystem supported so far). (default: none) Remember, that every node needs access to the same share under the same path.
21+
* *elasticsearch_bootstrap_pw*: Bootstrap password for Elasticsearch (Default: `PleaseChangeMe`)
1922
* *elasticsearch_disable_systemcallfilterchecks*: Disable system call filter checks. This has a security impact but is necessary on some systems. Please refer to the [docs](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/_system_call_filter_check.html) for details. (default: `false`)
2023
* *elasticsearch_pamlimits*: Set pam_limits neccessary for Elasticsearch. (Default: `true`)
2124

molecule/beats_default/converge.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
collections:
99
- NETWAYS.elasticstack
1010
vars:
11+
elastic_stack_full_stack: false
1112
elasticsearch_jna_workaround: true
1213
elasticsearch_disable_systemcallfilterchecks: true
14+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1315
tasks:
1416
- name: Include Elastics repos role
1517
include_role:

molecule/beats_full_stack/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- "testbed: molecule"
1818
elasticsearch_jna_workaround: true
1919
elasticsearch_disable_systemcallfilterchecks: true
20+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
2021
tasks:
2122
- name: Include Elastics repos role
2223
include_role:

molecule/beats_peculiar/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
beats_metricbeat: true
3434
metricbeat_output: logstash
3535
filebeat_docker: true
36+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
3637
tasks:
3738
- name: Set Filebeat version on RedHat
3839
set_fact:

molecule/elasticsearch_cluster-8/converge.yml

-18
This file was deleted.

molecule/elasticsearch_cluster-8/molecule.yml

-24
This file was deleted.

molecule/elasticsearch_cluster-8/prepare.yml

-36
This file was deleted.

molecule/elasticsearch_cluster-8/requirements.yml

-3
This file was deleted.

molecule/elasticsearch_cluster-oss/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
elastic_variant: oss
1010
elasticsearch_jna_workaround: true
1111
elasticsearch_disable_systemcallfilterchecks: true
12+
elastic_release: 7
1213
tasks:
1314
- name: Include Elastics repos role
1415
include_role:

molecule/elasticsearch_cluster/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
vars:
99
elasticsearch_jna_workaround: true
1010
elasticsearch_disable_systemcallfilterchecks: true
11+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1112
tasks:
1213
- name: Include Elastics repos role
1314
include_role:

molecule/elasticsearch_default/converge.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
- NETWAYS.elasticstack
77
hosts: all
88
vars:
9-
elasticsearch_enable: false
10-
elasticsearch_security: false
9+
#elasticsearch_security: true # needed for tests of > 7 releases
10+
elastic_stack_full_stack: false
1111
elasticsearch_jna_workaround: true
1212
elasticsearch_disable_systemcallfilterchecks: true
13+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1314
tasks:
1415
- name: Include Elastics repos role
1516
include_role:

molecule/elasticsearch_no-security/converge.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
hosts: all
88
vars:
99
elasticsearch_security: false
10+
elastic_security: false
1011
elasticsearch_jna_workaround: true
1112
elasticsearch_disable_systemcallfilterchecks: true
13+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1214
tasks:
1315
- name: Include Elastics repos role
1416
include_role:

molecule/elasticsearch_no-security/molecule.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ dependency:
44
driver:
55
name: docker
66
platforms:
7-
- name: elasticsearch_no_security
7+
- name: elasticsearch-nosecurity1
8+
groups:
9+
- elasticsearch
10+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
11+
command: ${MOLECULE_DOCKER_COMMAND:-""}
12+
volumes:
13+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
14+
cgroupns_mode: host
15+
privileged: true
16+
pre_build_image: true
17+
- name: elasticsearch-nosecurity2
818
groups:
919
- elasticsearch
1020
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"

molecule/elasticsearch_no-security/verify.yml

-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
elastic_initial_passwords: /usr/share/elasticsearch/initial_passwords
88
tasks:
99

10-
- name: Set elasticsearch_ca variable if not already done by user
11-
set_fact:
12-
elasticsearch_ca: "{{ groups['elasticsearch'][0] }}"
13-
when: elasticsearch_ca is undefined
14-
15-
- name: Fetch Elastic password
16-
shell: grep "PASSWORD elastic" {{ elastic_initial_passwords }} | awk {' print $4 '}
17-
register: elastic_password
18-
changed_when: false
19-
delegate_to: "{{ elasticsearch_ca }}"
20-
21-
2210
# Remember, this is the no-security scenario. So no https
2311
- name: Health check
2412
uri:

molecule/elasticstack_default/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
elasticsearch_disable_systemcallfilterchecks: true
99
elastic_stack_full_stack: true
1010
elastic_variant: oss
11+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1112
tasks:
1213
- name: Include Elastic Repos
1314
include_role:

molecule/kibana_default/converge.yml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# https://github.com/ansible-community/molecule/issues/1567#issuecomment-436876722
66
- name: Converge
77
hosts: all
8+
vars:
9+
elastic_stack_full_stack: false
10+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
811
collections:
912
- NETWAYS.elasticstack
1013
tasks:

molecule/kibana_full_stack-oss/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
vars:
1111
elastic_stack_full_stack: true
1212
elastic_variant: oss
13+
elastic_release: 7
1314
tasks:
1415
- name: Include Elastic Repos
1516
include_role:

molecule/kibana_full_stack/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- NETWAYS.elasticstack
1010
vars:
1111
elastic_stack_full_stack: true
12+
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
1213
tasks:
1314
- name: Include Elastic Repos
1415
include_role:

0 commit comments

Comments
 (0)