Skip to content

Upgrade el8/changes #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2dd31b5
add docs
Jan 31, 2023
580cfca
Add some Readme
widhalmt Jan 31, 2023
7982c68
add readme on redis, default password
Jan 31, 2023
8ada6d3
Change sorting of roles in playbook
widhalmt Jan 31, 2023
abab565
Install gpg-agent for repo handling on Ubuntu
widhalmt Jan 31, 2023
1c8687f
Merge branch 'main' into upgradeEL8/changes
widhalmt Feb 1, 2023
7f12048
added documentation on override and fix passwords
Feb 1, 2023
8e44781
Add tests for Elasticsearch 7 and 8
widhalmt Feb 1, 2023
c813b65
Add matrix release to pr checks
widhalmt Feb 1, 2023
62398c2
Cast elastic_release to int
widhalmt Feb 2, 2023
ca5dcf8
Set "full stack mode" as default
widhalmt Feb 2, 2023
41015be
Set release 8 as default
widhalmt Feb 2, 2023
c8e4b42
Merge branch 'main' into upgradeEL8/changes
Feb 2, 2023
a408be3
Set full stack to false due to changed default
widhalmt Feb 2, 2023
346e6dc
Merge branch 'upgradeEL8/changes' of github.com:NETWAYS/ansible-colle…
widhalmt Feb 2, 2023
41aac7f
Add checks for different versions to all defaults
widhalmt Feb 2, 2023
d357b10
Activate Elasticsearch security for version > 7
widhalmt Feb 2, 2023
fbf16ff
Typo in heap formula
widhalmt Feb 2, 2023
30ba720
Test version 8 with security disabled
widhalmt Feb 2, 2023
47cb026
Add tests for release 7 and 8
widhalmt Feb 3, 2023
5e56668
Merge branch 'main' into upgradeEL8/changes
widhalmt Feb 3, 2023
e70a86d
Test Elasticseach cluster without security
widhalmt Feb 3, 2023
2675c7d
Merge branch 'main' into upgradeEL8/changes
widhalmt Feb 3, 2023
099bb98
Merge branch 'main' into upgradeEL8/changes
widhalmt Feb 3, 2023
b317b7e
Typecast elastic_release
widhalmt Feb 6, 2023
2af7a3d
List which passwords can't be changed after init
widhalmt Feb 6, 2023
ecc65d8
Start Elasticsearch
widhalmt Feb 6, 2023
be00d1a
Typecast elasticsearch_heap
widhalmt Feb 6, 2023
c17794d
Merge branch 'main' into upgradeEL8/changes
widhalmt Feb 6, 2023
aff2e6c
Set higher timeout for Elasticsearch
widhalmt Feb 7, 2023
28afe22
Disabled setting bootstrap.system_call_filter for elasticsearch 8
danopt Feb 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test_full_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- rockylinux8
scenario:
- elasticstack_default
release:
- 7
- 8

steps:
- name: Check out code
Expand Down Expand Up @@ -56,3 +59,4 @@ jobs:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}
2 changes: 2 additions & 0 deletions .github/workflows/test_role_beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
matrix:
distro: [debian11, rockylinux8, ubuntu2204]
scenario: [beats_default, beats_full_stack, beats_peculiar]
release: [ 7, 8 ]

steps:
- name: Check out code
Expand Down Expand Up @@ -98,3 +99,4 @@ jobs:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}
2 changes: 2 additions & 0 deletions .github/workflows/test_role_elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
matrix:
distro: [ubuntu2204]
scenario: [elasticsearch_default, elasticsearch_cluster, elasticsearch_cluster-oss, elasticsearch_no-security]
release: [7, 8]

steps:
- name: Check out code
Expand All @@ -96,5 +97,6 @@ jobs:
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
ELASTIC_RELEASE: ${{ matrix.release }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
2 changes: 2 additions & 0 deletions .github/workflows/test_role_kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
matrix:
distro: [ubuntu2204]
scenario: [kibana_default, kibana_full_stack, kibana_full_stack-oss]
release: [ 7, 8 ]

steps:
- name: Check out code
Expand All @@ -96,3 +97,4 @@ jobs:
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
ELASTIC_RELEASE: ${{ matrix.release }}
4 changes: 4 additions & 0 deletions .github/workflows/test_role_logstash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
matrix:
distro: [ubuntu2204]
scenario: [logstash_default]
release: [ 7, 8 ]

steps:
- name: Check out code
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}

molecule_tests:
runs-on: ubuntu-latest
Expand All @@ -115,6 +117,7 @@ jobs:
logstash_full_stack-oss,
logstash_specific_version,
logstash_pipelines]
release: [ 7, 8 ]

steps:
- name: Check out code
Expand Down Expand Up @@ -142,3 +145,4 @@ jobs:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}
4 changes: 3 additions & 1 deletion .github/workflows/test_role_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ jobs:
matrix:

distro: [centos7, debian10, debian11, rockylinux8, rockylinux9, ubuntu2004, ubuntu2204]
scenario: [repos_default, repos_oss, repos_elastic8]
scenario: [repos_default, repos_oss]
release: [ 7, 8 ]

steps:
- name: Check out code
Expand All @@ -97,3 +98,4 @@ jobs:
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
ELASTIC_RELEASE: ${{ matrix.release }}
4 changes: 4 additions & 0 deletions .github/workflows/test_roles_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- kibana_default
- logstash_default
- repos_default
release:
- 7
- 8

steps:
- name: Check out code
Expand Down Expand Up @@ -55,3 +58,4 @@ jobs:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,32 @@ You may want the following Ansible roles installed. There other ways to achieve

## Usage

### Default Passwords

Default Passwords can be seen during generation, or found later in `/usr/share/elasticsearch/initial_passwords`

To turn off security currently:
`elastic_override_beats_tls: true`
### Redis

0) You need to install the redis role which is maintained by geerlingguy.

```
ansible-galaxy install geerlingguy.redis
```

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)

2) Specific: For OSS Installation without X-Pack features you can use the following. _Note_ this is only available for version `7.x`.

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.

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.

_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.

The execution order of the roles is important! (see below)

```
---
- hosts: all
Expand Down Expand Up @@ -74,5 +93,4 @@ The execution order of the roles is important! (see below)
- logstash
- kibana
- beats

```
3 changes: 3 additions & 0 deletions docs/role-elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This role installs manages Elasticsearch on your hosts. Optionally it can config

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

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.

Role Variables
--------------

Expand All @@ -16,6 +18,7 @@ Role Variables
* *elasticsearch_datapath*: Path where Elasticsearch will store it's data. (default: `/var/lib/elasticsearch` - the packages default)
* *elasticsearch_create_datapath*: Create the path for data to store if it doesn't exist. (default: `false` - only useful if you change `elasticsearch_datapath`)
* *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.
* *elasticsearch_bootstrap_pw*: Bootstrap password for Elasticsearch (Default: `PleaseChangeMe`)
* *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`)
* *elasticsearch_pamlimits*: Set pam_limits neccessary for Elasticsearch. (Default: `true`)

Expand Down
2 changes: 2 additions & 0 deletions molecule/beats_default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
collections:
- NETWAYS.elasticstack
vars:
elastic_stack_full_stack: false
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
1 change: 1 addition & 0 deletions molecule/beats_full_stack/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- "testbed: molecule"
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
1 change: 1 addition & 0 deletions molecule/beats_peculiar/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
beats_metricbeat: true
metricbeat_output: logstash
filebeat_docker: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Set Filebeat version on RedHat
set_fact:
Expand Down
18 changes: 0 additions & 18 deletions molecule/elasticsearch_cluster-8/converge.yml

This file was deleted.

24 changes: 0 additions & 24 deletions molecule/elasticsearch_cluster-8/molecule.yml

This file was deleted.

36 changes: 0 additions & 36 deletions molecule/elasticsearch_cluster-8/prepare.yml

This file was deleted.

3 changes: 0 additions & 3 deletions molecule/elasticsearch_cluster-8/requirements.yml

This file was deleted.

1 change: 1 addition & 0 deletions molecule/elasticsearch_cluster-oss/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
elastic_variant: oss
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: 7
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
1 change: 1 addition & 0 deletions molecule/elasticsearch_cluster/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
vars:
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
5 changes: 3 additions & 2 deletions molecule/elasticsearch_default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
- NETWAYS.elasticstack
hosts: all
vars:
elasticsearch_enable: false
elasticsearch_security: false
#elasticsearch_security: true # needed for tests of > 7 releases
elastic_stack_full_stack: false
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
2 changes: 2 additions & 0 deletions molecule/elasticsearch_no-security/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
hosts: all
vars:
elasticsearch_security: false
elastic_security: false
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastics repos role
include_role:
Expand Down
12 changes: 11 additions & 1 deletion molecule/elasticsearch_no-security/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ dependency:
driver:
name: docker
platforms:
- name: elasticsearch_no_security
- name: elasticsearch-nosecurity1
groups:
- elasticsearch
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: elasticsearch-nosecurity2
groups:
- elasticsearch
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
Expand Down
12 changes: 0 additions & 12 deletions molecule/elasticsearch_no-security/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
elastic_initial_passwords: /usr/share/elasticsearch/initial_passwords
tasks:

- name: Set elasticsearch_ca variable if not already done by user
set_fact:
elasticsearch_ca: "{{ groups['elasticsearch'][0] }}"
when: elasticsearch_ca is undefined

- name: Fetch Elastic password
shell: grep "PASSWORD elastic" {{ elastic_initial_passwords }} | awk {' print $4 '}
register: elastic_password
changed_when: false
delegate_to: "{{ elasticsearch_ca }}"


# Remember, this is the no-security scenario. So no https
- name: Health check
uri:
Expand Down
1 change: 1 addition & 0 deletions molecule/elasticstack_default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
elasticsearch_disable_systemcallfilterchecks: true
elastic_stack_full_stack: true
elastic_variant: oss
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastic Repos
include_role:
Expand Down
3 changes: 3 additions & 0 deletions molecule/kibana_default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# https://github.com/ansible-community/molecule/issues/1567#issuecomment-436876722
- name: Converge
hosts: all
vars:
elastic_stack_full_stack: false
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
collections:
- NETWAYS.elasticstack
tasks:
Expand Down
1 change: 1 addition & 0 deletions molecule/kibana_full_stack-oss/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
vars:
elastic_stack_full_stack: true
elastic_variant: oss
elastic_release: 7
tasks:
- name: Include Elastic Repos
include_role:
Expand Down
1 change: 1 addition & 0 deletions molecule/kibana_full_stack/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- NETWAYS.elasticstack
vars:
elastic_stack_full_stack: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
tasks:
- name: Include Elastic Repos
include_role:
Expand Down
Loading