You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
981 B

---
- 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'] }}"