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.

41 lines
998 B

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