Skip to content

Commit

Permalink
salt: Add check pillar in etcd orchestrate
Browse files Browse the repository at this point in the history
During etcd orchestrate etcd to deploy etcd we need to have information
about repository endpoint, so check this pillar value before running the
salt state on the minion
  • Loading branch information
TeddyAndrieux committed Apr 22, 2020
1 parent 0320fad commit a900a46
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion salt/metalk8s/orchestrate/etcd.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@ Sync {{ node }} minion:
- kwarg:
saltenv: metalk8s-{{ dest_version }}

Check pillar on {{ node }}:
salt.function:
- name: metalk8s.check_pillar_keys
- tgt: {{ node }}
- kwarg:
keys:
- metalk8s.endpoints.repositories.ip
- metalk8s.endpoints.repositories.ports.http
# We cannot raise when using `salt.function` as we need to return
# `False` to have a failed state
# https://github.com/saltstack/salt/issues/55503
raise_error: False
- retry:
attempts: 5
- require:
- salt: Sync {{ node }} minion

Deploy etcd {{ node }} to {{ dest_version }}:
salt.state:
- tgt: {{ node }}
- sls:
- metalk8s.kubernetes.etcd
- saltenv: metalk8s-{{ dest_version }}
- require:
- salt: Sync {{ node }} minion
- salt: Check pillar on {{ node }}
- module: Check etcd cluster health
{%- if previous_node is defined %}
- metalk8s: Check etcd cluster health for {{ previous_node }}
Expand Down

0 comments on commit a900a46

Please sign in to comment.