2015-10-03 20:19:50 +00:00
|
|
|
---
|
|
|
|
- name: tokens | copy the token gen script
|
|
|
|
copy:
|
|
|
|
src=kube-gen-token.sh
|
|
|
|
dest={{ kube_script_dir }}
|
|
|
|
mode=u+x
|
|
|
|
|
|
|
|
- name: tokens | generate tokens for master components
|
|
|
|
command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
|
|
|
|
environment:
|
|
|
|
TOKEN_DIR: "{{ kube_token_dir }}"
|
|
|
|
with_nested:
|
2015-12-11 10:32:13 +00:00
|
|
|
- [ "system:kubectl" ]
|
|
|
|
- "{{ groups['kube-master'] }}"
|
2015-10-03 20:19:50 +00:00
|
|
|
register: gentoken
|
|
|
|
changed_when: "'Added' in gentoken.stdout"
|
|
|
|
|
|
|
|
- name: tokens | generate tokens for node components
|
|
|
|
command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
|
|
|
|
environment:
|
|
|
|
TOKEN_DIR: "{{ kube_token_dir }}"
|
|
|
|
with_nested:
|
2015-12-11 10:32:13 +00:00
|
|
|
- [ 'system:kubelet' ]
|
2015-10-03 20:19:50 +00:00
|
|
|
- "{{ groups['kube-node'] }}"
|
|
|
|
register: gentoken
|
|
|
|
changed_when: "'Added' in gentoken.stdout"
|