Skip to content

Commit

Permalink
Updated etcd molecule test to check on different protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
klention committed Dec 21, 2024
1 parent 3a34ac1 commit e4b34d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
24 changes: 12 additions & 12 deletions automation/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@

# if dcs_exists: false and dcs_type: "etcd"
[etcd_cluster] # recommendation: 3, or 5-7 nodes
#10.128.64.140
#10.128.64.142
#10.128.64.143
10.16.16.209
10.16.16.210
10.16.16.211

# if dcs_exists: false and dcs_type: "consul"
[consul_instances] # recommendation: 3 or 5-7 nodes
#10.128.64.140 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
#10.128.64.142 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
#10.128.64.143 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
10.16.16.209 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
10.16.16.210 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
10.16.16.211 consul_node_role=server consul_bootstrap_expect=true consul_datacenter=dc1
#10.128.64.144 consul_node_role=client consul_datacenter=dc2
#10.128.64.145 consul_node_role=client consul_datacenter=dc2

# if with_haproxy_load_balancing: true
[balancers]
#10.128.64.140 # balancer_tags="datacenter=dc1"
#10.128.64.142 # balancer_tags="datacenter=dc1"
#10.128.64.143 # balancer_tags="datacenter=dc1"
10.16.16.209 # balancer_tags="datacenter=dc1"
10.16.16.210 # balancer_tags="datacenter=dc1"
10.16.16.211 # balancer_tags="datacenter=dc1"
#10.128.64.144 balancer_tags="datacenter=dc2"
#10.128.64.145 balancer_tags="datacenter=dc2" new_node=true

# PostgreSQL nodes
[master]
#10.128.64.140 hostname=pgnode01 postgresql_exists=false # patroni_tags="datacenter=dc1"
10.16.16.209 hostname=pgnode01 postgresql_exists=false # patroni_tags="datacenter=dc1"

[replica]
#10.128.64.142 hostname=pgnode02 postgresql_exists=false # patroni_tags="datacenter=dc1"
#10.128.64.143 hostname=pgnode03 postgresql_exists=false # patroni_tags="datacenter=dc1"
10.16.16.210 hostname=pgnode02 postgresql_exists=false # patroni_tags="datacenter=dc1"
10.16.16.211 hostname=pgnode03 postgresql_exists=false # patroni_tags="datacenter=dc1"
#10.128.64.144 hostname=pgnode04 postgresql_exists=false patroni_tags="datacenter=dc2"
#10.128.64.145 hostname=pgnode04 postgresql_exists=false patroni_tags="datacenter=dc2" new_node=true

Expand Down
9 changes: 7 additions & 2 deletions automation/molecule/tests/etcd/etcd.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
- name: Check etcd health
- name: Check etcd health with TLS
ansible.builtin.uri:
url: "http://{{ inventory_hostname }}:2379/health"
url: "{% if tls_cert_generate | bool %}https{% else %}http{% endif %}://{{ inventory_hostname }}:2379/health"
method: GET
return_content: true
validate_certs: "{% if tls_cert_generate | bool %}true{% else %}false{% endif %}"
ca_path: "{% if tls_cert_generate | bool %}/var/lib/pgsql/tls/ca.crt{% else %}''{% endif %}"
client_cert: "{% if tls_cert_generate | bool %}/var/lib/pgsql/tls/server.crt{% else %}''{% endif %}"
client_key: "{% if tls_cert_generate | bool %}/var/lib/pgsql/tls/server.key{% else %}''{% endif %}"
register: etcd_health_status
failed_when: "(etcd_health_status.content | from_json).health != 'true'"
when: dcs_type == "etcd"

0 comments on commit e4b34d3

Please sign in to comment.