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.

27 lines
887 B

  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. when: inventory_hostname == groups['kube-master'][0]
  8. - name: tokens | generate tokens for calico
  9. command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
  10. environment:
  11. TOKEN_DIR: "{{ kube_token_dir }}"
  12. with_nested:
  13. - [ "system:calico" ]
  14. - "{{ groups['k8s-cluster'] }}"
  15. register: gentoken_calico
  16. changed_when: "'Added' in gentoken_calico.stdout"
  17. when: kube_network_plugin == "calico"
  18. delegate_to: "{{ groups['kube-master'][0] }}"
  19. notify: set is_gentoken_calico fact
  20. - name: tokens | get the calico token values
  21. slurp:
  22. src: "{{ kube_token_dir }}/system:calico-{{ inventory_hostname }}.token"
  23. register: calico_token
  24. when: kube_network_plugin == "calico"
  25. delegate_to: "{{ groups['kube-master'][0] }}"