Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
4c682951
Commit
4c682951
authored
8 years ago
by
Matthew Mosesohn
Browse files
Options
Downloads
Patches
Plain Diff
Fix etcd idempotency
parent
7cb7eee2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/etcd/tasks/check_certs.yml
+1
-1
1 addition, 1 deletion
roles/etcd/tasks/check_certs.yml
roles/etcd/tasks/gen_certs_script.yml
+10
-8
10 additions, 8 deletions
roles/etcd/tasks/gen_certs_script.yml
with
11 additions
and
9 deletions
roles/etcd/tasks/check_certs.yml
+
1
−
1
View file @
4c682951
...
...
@@ -61,7 +61,7 @@
{% if gen_node_certs[inventory_hostname] or
(not etcdcert_node.results[0].stat.exists|default(False)) or
(not etcdcert_node.results[1].stat.exists|default(False)) or
(etcdcert_node.results[1].stat.checksum|default('') != etcdcert_master.files|selectattr("path", "equalto", etcdcert_node.results[1].stat.path)|
first|
map(attribute="checksum")|default('')) -%}
(etcdcert_node.results[1].stat.checksum|default('') != etcdcert_master.files|selectattr("path", "equalto", etcdcert_node.results[1].stat.path)|map(attribute="checksum")|
first|
default('')) -%}
{%- set _ = certs.update({'sync': True}) -%}
{% endif %}
{{ certs.sync }}
...
...
This diff is collapsed.
Click to expand it.
roles/etcd/tasks/gen_certs_script.yml
+
10
−
8
View file @
4c682951
...
...
@@ -4,7 +4,8 @@
path
:
"
{{
etcd_cert_dir
}}"
group
:
"
{{
etcd_cert_group
}}"
state
:
directory
owner
:
root
owner
:
kube
mode
:
0700
recurse
:
yes
-
name
:
"
Gen_certs
|
create
etcd
script
dir
(on
{{groups['etcd'][0]}})"
...
...
@@ -12,6 +13,7 @@
path
:
"
{{
etcd_script_dir
}}"
state
:
directory
owner
:
root
mode
:
0700
run_once
:
yes
delegate_to
:
"
{{groups['etcd'][0]}}"
...
...
@@ -20,8 +22,9 @@
path
:
"
{{
etcd_cert_dir
}}"
group
:
"
{{
etcd_cert_group
}}"
state
:
directory
owner
:
root
owner
:
kube
recurse
:
yes
mode
:
0700
run_once
:
yes
delegate_to
:
"
{{groups['etcd'][0]}}"
...
...
@@ -42,6 +45,7 @@
delegate_to
:
"
{{groups['etcd'][0]}}"
when
:
gen_certs|default(false)
-
name
:
Gen_certs | run cert generation script
command
:
"
bash
-x
{{
etcd_script_dir
}}/make-ssl-etcd.sh
-f
{{
etcd_config_dir
}}/openssl.conf
-d
{{
etcd_cert_dir
}}"
environment
:
...
...
@@ -114,7 +118,9 @@
-
name
:
Gen_certs | Prepare tempfile for unpacking certs
shell
:
mktemp /tmp/certsXXXXX.tar.gz
register
:
cert_tempfile
when
:
inventory_hostname in groups['etcd'] and sync_certs|default(false) and
inventory_hostname != groups['etcd'][0]
-
name
:
Gen_certs | Write master certs to tempfile
copy
:
content
:
"
{{etcd_master_cert_data.stdout}}"
...
...
@@ -154,13 +160,9 @@
group
:
"
{{
etcd_cert_group
}}"
state
:
directory
owner
:
kube
mode
:
"
u=rwX,g-rwx,o-rwx"
recurse
:
yes
-
name
:
Gen_certs | set permissions on keys
shell
:
chmod 0600 {{ etcd_cert_dir}}/*key.pem
when
:
inventory_hostname in groups['etcd']
changed_when
:
false
-
name
:
Gen_certs | target ca-certificate store file
set_fact
:
ca_cert_path
:
|-
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment