forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate secrets on deployment machine
test travis with sudo=true instead of required
- Loading branch information
Showing
19 changed files
with
157 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- role: kubernetes/secrets |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- name: set secret_changed | ||
set_fact: | ||
secret_changed: true |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
- name: certs | write openssl config | ||
sudo: False | ||
local_action: template src="openssl.conf.j2" dest="{{ role_path }}/files/openssl.conf" | ||
run_once: yes | ||
|
||
- name: certs | run cert generation script | ||
sudo: False | ||
local_action: shell | ||
{{ role_path }}/scripts/make-ssl.sh | ||
-f {{ role_path }}/files/openssl.conf | ||
-d {{ role_path }}/files/certs/ | ||
run_once: yes | ||
|
||
- name: certs | Copy certs on nodes | ||
copy: | ||
src: "certs/{{ item }}" | ||
dest: "{{ kube_cert_dir }}" | ||
with_items: | ||
- ca.pem | ||
- node.pem | ||
- node-key.pem | ||
when: inventory_hostname in "{{ groups['k8s-cluster'] }}" | ||
|
||
- name: certs | Copy certs on master | ||
copy: | ||
src: "certs/{{ item }}" | ||
dest: "{{ kube_cert_dir }}" | ||
with_items: | ||
- ca-key.pem | ||
- admin.pem | ||
- admin-key.pem | ||
- apiserver-key.pem | ||
- apiserver.pem | ||
when: inventory_hostname in "{{ groups['kube-master'] }}" | ||
|
||
- name: certs | check certificate permissions | ||
file: | ||
path={{ kube_cert_dir }} | ||
group={{ kube_cert_group }} | ||
owner=kube | ||
recurse=yes | ||
|
||
- shell: ls {{ kube_cert_dir}}/*key.pem | ||
register: keyfiles | ||
|
||
- name: certs | set permissions on keys | ||
file: | ||
path: "{{ item }}" | ||
mode: 0600 | ||
with_items: keyfiles.stdout_lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
- name: tokens | generate tokens for master components | ||
sudo: False | ||
local_action: command "{{ role_path }}/scripts/kube-gen-token.sh" "{{ item[0] }}-{{ item[1] }}" | ||
environment: | ||
TOKEN_DIR: "{{ role_path }}/files/tokens" | ||
with_nested: | ||
- [ "system:kubectl" ] | ||
- "{{ groups['kube-master'] }}" | ||
register: gentoken_master | ||
changed_when: "'Added' in gentoken_master.stdout" | ||
notify: set secret_changed | ||
|
||
- name: tokens | generate tokens for node components | ||
sudo: False | ||
local_action: command "{{ role_path }}/scripts/kube-gen-token.sh" "{{ item[0] }}-{{ item[1] }}" | ||
environment: | ||
TOKEN_DIR: "{{ role_path }}/files/tokens" | ||
with_nested: | ||
- [ 'system:kubelet' ] | ||
- "{{ groups['kube-node'] }}" | ||
register: gentoken_node | ||
changed_when: "'Added' in gentoken_node.stdout" | ||
notify: set secret_changed | ||
|
||
- name: tokens | Copy tokens on master | ||
copy: | ||
src: "tokens" | ||
dest: "/etc/kubernetes" | ||
when: inventory_hostname in "{{ groups['kube-master'] }}" |
Oops, something went wrong.