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.

38 lines
901 B

  1. ---
  2. - include: check-certs.yml
  3. - include: check-tokens.yml
  4. - name: Make sure the certificate directory exits
  5. file:
  6. path={{ kube_cert_dir }}
  7. state=directory
  8. mode=o-rwx
  9. group={{ kube_cert_group }}
  10. - name: Make sure the tokens directory exits
  11. file:
  12. path={{ kube_token_dir }}
  13. state=directory
  14. mode=o-rwx
  15. group={{ kube_cert_group }}
  16. - name: Make sure the users directory exits
  17. file:
  18. path={{ kube_users_dir }}
  19. state=directory
  20. mode=o-rwx
  21. group={{ kube_cert_group }}
  22. - name: Populate users for basic auth in API
  23. lineinfile:
  24. dest: "{{ kube_users_dir }}/known_users.csv"
  25. create: yes
  26. line: '{{ item.value.pass }},{{ item.key }},{{ item.value.role }}'
  27. backup: yes
  28. with_dict: "{{ kube_users }}"
  29. when: inventory_hostname in "{{ groups['kube-master'] }}"
  30. notify: set secret_changed
  31. - include: gen_certs.yml
  32. - include: gen_tokens.yml