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.

26 lines
789 B

9 years ago
9 years ago
9 years ago
  1. ---
  2. - name: tokens | copy the token gen script
  3. copy:
  4. src=kube-gen-token.sh
  5. dest={{ kube_script_dir }}
  6. mode=u+x
  7. - name: tokens | generate tokens for master components
  8. command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
  9. environment:
  10. TOKEN_DIR: "{{ kube_token_dir }}"
  11. with_nested:
  12. - [ "system:kubectl" ]
  13. - "{{ groups['kube-master'] }}"
  14. register: gentoken
  15. changed_when: "'Added' in gentoken.stdout"
  16. - name: tokens | generate tokens for node components
  17. command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
  18. environment:
  19. TOKEN_DIR: "{{ kube_token_dir }}"
  20. with_nested:
  21. - [ 'system:kubelet' ]
  22. - "{{ groups['kube-node'] }}"
  23. register: gentoken
  24. changed_when: "'Added' in gentoken.stdout"