You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding playbook contributed by @xtruthx
I have to admit, I kept this playbook for waaaaay too long. @xtruthx
sent it to me a long while back and I always planned to integrate it
into the codebase of this collection.
Now I had to face that I took too long and so I put it up publicly. Now
I worked it over so that it will fit into the `elasticsearch` role just
well.
This PR also introduces a new role where all "global" variables can be
found. This will help determining the correct version of a package to
install. Some tasks that were repeated in every role get moved into this
role called `elasticstack` to streamline execution.
This PR now reads the current version of Elasticsearch installed on the
CA host and uses it as new installation target for all further
installations. This not only helps with upgrading, it will also make
sure that you won't have a version mismatch if you install components
after the initial install.
Special thanks to @hryamzik for the workaround to run a task file like
with `serial: 1`. Found in
ansible/ansible#12170 (comment)
Very special thanks to CID GmbH for sponsoring parts of the the
development of this PR.
fixes#216fixes#286fixes#236fixes#205
---------
Co-authored-by: Daniel Neuberger <[email protected]>
Copy file name to clipboardExpand all lines: NOTICE.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@
4
4
5
5
Here's a list of sponsors who contributed by having the collection improved via outsourcing to NETWAYS.
6
6
7
-
* CID GmbH : Thank you so much for sponsoring. Especially the feature to have different types of Elasticsearch nodes in the cluster.
7
+
* CID GmbH : Thank you so much for sponsoring. Especially the feature to have different types of Elasticsearch nodes in the cluster and the ingetration of rolling upgrades.
Copy file name to clipboardExpand all lines: README.md
+12-4
Original file line number
Diff line number
Diff line change
@@ -79,13 +79,13 @@ You will want to have reliable DNS resolution or enter all hosts of the stack in
79
79
80
80
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.
81
81
82
-
### Versioning
82
+
### Versions and upgrades
83
83
84
-
*elasticstack_version*: Version number of tools to install. Only set if you don't want the latest. (default: none).
84
+
*elasticstack_version*: Version number of tools to install. Only set if you don't want the latest on new setups. (default: none). If you already have an installation of Elastic Stack, this collection will query the version of Elasticsearch on the CA host and use it for all further installations in the same setup. (Only if you run the `elasticsearch` role before all others) Example: `7.17.2`
85
85
86
-
*elasticstack_release*: Major release version of Elastic stack to configure. (default: `7`)
86
+
*elasticstack_release*: Major release version of Elastic stack to configure. (default: `7`) Make sure it corresponds to `elasticstack_version` if you set both.
87
87
88
-
For OSS version see `elasticstack_variant` below.**IMPORTANT** Do not change the version once you have set up the stack. There are unpredictable effects to be expected when using this for upgrades. And upgrade mechanism is already on it's way. (default: none. Example: `7.17.2`)
88
+
For OSS version see `elasticstack_variant` below.
89
89
90
90
*elasticstack_variant*: Variant of the stack to install. Valid values: `elastic` or `oss`. (default: `elastic`)
91
91
@@ -99,6 +99,14 @@ roles:
99
99
elasticstack_version: 8.8.1
100
100
```
101
101
102
+
#### Upgrades ####
103
+
104
+
Set `elasticstack_version` to the version you want to upgrade to. Positively do read and understand Elastics changelog and "breaking changes" of your target version and all between your current and the target version. Do not use unless you have a valid backup.
105
+
106
+
If an upgrade fails, you can try re-running the collection with the same settings. There are several tasks that can provide "self-healing". Please do not rely on these mechanisms, they are more of a "convenience recovery" for easier steps.
107
+
108
+
The collection will make sure to upgrade Elasticsearch nodes one by one.
109
+
102
110
### Default Passwords
103
111
104
112
Default passwords can be seen during generation, or found later in `/usr/share/elasticsearch/initial_passwords`
Copy file name to clipboardExpand all lines: docs/role-elasticsearch.md
+5
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Role Variables
13
13
--------------
14
14
15
15
**elasticsearch_node_types*: List of types of this very node. Please refer to [official docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html) for details. (default: not set. allowed value: array of types)
16
+
+*elasticsearch_nodename*': Node name of the Elasticsearch node. (default: value of `ansible_hostname`)
16
17
**elasticsearch_clustername*: Name the Elasticsearch Cluster (default: `elasticsearch`)
17
18
**elasticsearch_heap*: Heapsize for Elasticsearch. (Half of free memory on host. Maximum 30GB. (default: Half of hosts memory. Min 1GB, Max 30GB)
18
19
**elasticsearch_tls_key_passphrase*: Passphrase for elasticsearch certificates (default: `PleaseChangeMeIndividually`)
@@ -53,6 +54,10 @@ This variable activates a workaround to start on systems that have certain harde
53
54
* *elasticsearch_seed_hosts*: Set elasticsearch seed hosts
54
55
* *elasticsearch_security_enrollment*: Controls enrollment (of nodes and Kibana) to a local node that’s been autoconfigured for security.
55
56
57
+
The following variable was only integrated to speed up upgrades of non-production clusters. Use with caution and at your own risk:
58
+
59
+
* *elasticsearch_unsafe_upgrade_restart*: This will still perform rolling upgrades, but will first update the package and then restart the service. In contrast the default behaviour is to stop the service, do the upgrade and then start again. (default: `false`)
60
+
56
61
These variables are identical over all our elastic related roles, hence the different naming schemes.
57
62
58
63
* *elasticstack_ca*: Set to the inventory hostname of the host that should house the CA for certificates for inter-node communication. (default: First node in the `elasticsearch` host group)
0 commit comments