Skip to content

Commit e9facfc

Browse files
authored
15.0.0+3.5.26 (#46)
* increase min_ansible_version to 2.10 in meta/main.yml * replace injected ansible_* facts usage with ansible_facts[...] (prepares for ansible-core 2.24 where INJECT_FACTS_AS_VARS default changes) * update CHANGELOG/README
1 parent 2dbc1b5 commit e9facfc

5 files changed

Lines changed: 20 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
55

66
# Changelog
77

8+
## 15.0.0+3.5.26
9+
10+
- increase `min_ansible_version` to `2.10` in `meta/main.yml`
11+
- replace injected `ansible_*` facts usage with `ansible_facts[...]` (prepares for ansible-core 2.24 where INJECT_FACTS_AS_VARS default changes)
12+
- allow specifying external IPs for etcd peer/client URLs when not available via Ansible facts - see [#44](https://github.com/githubixx/ansible-role-etcd/pull/44) (contribution by @pavlozt)
13+
814
## 14.0.4+3.5.26
915

1016
**NOTE**: If you use `etcd` for Kubernetes and want to upgrade to `etcd` `v3.6` you **DEFINITELY** want to upgrade to `etcd` `v3.6.26` first! For further information:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Upgrading a etcd cluster which was installed by this role is described in [here]
1414

1515
## Versions
1616

17-
I tag every release and try to stay with [semantic versioning](http://semver.org). If you want to use the role I recommend to checkout the latest tag. The master branch is basically development while the tags mark stable releases. But in general I try to keep master in good shape too. A tag `14.0.4+3.5.26` means this is release `14.0.4` of this role and it's meant to be used with etcd version `3.5.26` (but should work with newer versions also). If the role itself changes `X.Y.Z` before `+` will increase. If the etcd version changes `X.Y.Z` after `+` will increase. This allows to tag bugfixes and new major versions of the role while it's still developed for a specific etcd release.
17+
I tag every release and try to stay with [semantic versioning](http://semver.org). If you want to use the role I recommend to checkout the latest tag. The master branch is basically development while the tags mark stable releases. But in general I try to keep master in good shape too. A tag `15.0.0+3.5.26` means this is release `15.0.0` of this role and it's meant to be used with etcd version `3.5.26` (but should work with newer versions also). If the role itself changes `X.Y.Z` before `+` will increase. If the etcd version changes `X.Y.Z` after `+` will increase. This allows to tag bugfixes and new major versions of the role while it's still developed for a specific etcd release.
1818

1919
## Changelog
2020

@@ -40,7 +40,7 @@ This role requires that you already created some certificates for `etcd` (see [K
4040
roles:
4141
- name: githubixx.etcd
4242
src: https://github.com/githubixx/ansible-role-etcd.git
43-
version: 14.0.4+3.5.26
43+
version: 15.0.0+3.5.26
4444
```
4545
4646
## Role Variables
@@ -214,17 +214,17 @@ etcd_service_options:
214214
- CapabilityBoundingSet=~CAP_SYS_PTRACE
215215

216216
etcd_settings:
217-
"name": "{{ ansible_hostname }}"
217+
"name": "{{ ansible_facts['hostname'] }}"
218218
"cert-file": "{{ etcd_conf_dir }}/cert-etcd-server.pem"
219219
"key-file": "{{ etcd_conf_dir }}/cert-etcd-server-key.pem"
220220
"trusted-ca-file": "{{ etcd_conf_dir }}/ca-etcd.pem"
221221
"peer-cert-file": "{{ etcd_conf_dir }}/cert-etcd-peer.pem"
222222
"peer-key-file": "{{ etcd_conf_dir }}/cert-etcd-peer-key.pem"
223223
"peer-trusted-ca-file": "{{ etcd_conf_dir }}/ca-etcd.pem"
224-
"advertise-client-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_client_port }}"
225-
"initial-advertise-peer-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_peer_port }}"
226-
"listen-peer-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_peer_port }}"
227-
"listen-client-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_client_port + ',https://127.0.0.1:' + etcd_client_port }}"
224+
"advertise-client-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_client_port }}"
225+
"initial-advertise-peer-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_peer_port }}"
226+
"listen-peer-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_peer_port }}"
227+
"listen-client-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_client_port + ',https://127.0.0.1:' + etcd_client_port }}"
228228
"peer-client-cert-auth": "true" # Enable peer client cert authentication
229229
"client-cert-auth": "true" # Enable client cert authentication
230230
"initial-cluster-token": "etcd-cluster-0" # Initial cluster token for the etcd cluster during bootstrap.

defaults/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@ etcd_service_options:
173173
- CapabilityBoundingSet=~CAP_SYS_PTRACE
174174

175175
etcd_settings:
176-
"name": "{{ ansible_hostname }}"
176+
"name": "{{ ansible_facts['hostname'] }}"
177177
"cert-file": "{{ etcd_conf_dir }}/cert-etcd-server.pem"
178178
"key-file": "{{ etcd_conf_dir }}/cert-etcd-server-key.pem"
179179
"trusted-ca-file": "{{ etcd_conf_dir }}/ca-etcd.pem"
180180
"peer-cert-file": "{{ etcd_conf_dir }}/cert-etcd-peer.pem"
181181
"peer-key-file": "{{ etcd_conf_dir }}/cert-etcd-peer-key.pem"
182182
"peer-trusted-ca-file": "{{ etcd_conf_dir }}/ca-etcd.pem"
183-
"advertise-client-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_client_port }}"
184-
"initial-advertise-peer-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_peer_port }}"
185-
"listen-peer-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_peer_port }}"
186-
"listen-client-urls": "{{ 'https://' + hostvars[inventory_hostname]['ansible_' + etcd_interface].ipv4.address + ':' + etcd_client_port + ',https://127.0.0.1:' + etcd_client_port }}"
183+
"advertise-client-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_client_port }}"
184+
"initial-advertise-peer-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_peer_port }}"
185+
"listen-peer-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_peer_port }}"
186+
"listen-client-urls": "{{ 'https://' + ansible_facts[etcd_interface]['ipv4']['address'] + ':' + etcd_client_port + ',https://127.0.0.1:' + etcd_client_port }}"
187187
"peer-client-cert-auth": "true" # Enable peer client cert authentication
188188
"client-cert-auth": "true" # Enable client cert authentication
189189
"initial-cluster-token": "etcd-cluster-0" # Initial cluster token for the etcd cluster during bootstrap.

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ galaxy_info:
66
author: Robert Wimmer
77
description: Installs etcd cluster.
88
license: GPLv3
9-
min_ansible_version: "2.9"
9+
min_ansible_version: "2.10"
1010
role_name: etcd
1111
namespace: githubixx
1212
platforms:

templates/etc/systemd/system/etcd.service.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{%- if not etcd_settings.get('discovery-srv') and not etcd_settings.get('initial-cluster') %}
66
{%- macro cluster_hosts() -%}
77
{%- for host in groups[etcd_ansible_group] -%}
8-
{{ hostvars[host]['ansible_hostname'] }}=https://{{ hostvars[host]['ansible_' + etcd_interface].ipv4.address }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}
8+
{{ hostvars[host]['ansible_facts']['hostname'] }}=https://{{ hostvars[host]['ansible_facts'][etcd_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}
99
{%- endfor -%}
1010
{%- endmacro -%}
1111
{%- set etcd_settings = etcd_settings | combine({'initial-cluster': cluster_hosts()}) -%}

0 commit comments

Comments
 (0)