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.

37 lines
873 B

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