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
1.1 KiB

  1. ---
  2. - name: sync_etcd_master_certs | Create list of master certs needing creation
  3. set_fact:
  4. etcd_master_cert_list: >-
  5. {{ etcd_master_cert_list|default([]) + [
  6. "admin-" + item + ".pem",
  7. "member-" + item + ".pem"
  8. ] }}
  9. with_items: "{{ groups.etcd }}"
  10. - include: ../../vault/tasks/shared/sync_file.yml
  11. vars:
  12. sync_file: "{{ item }}"
  13. sync_file_dir: "{{ etcd_cert_dir }}"
  14. sync_file_hosts: "{{ groups.etcd }}"
  15. sync_file_is_cert: true
  16. with_items: "{{ etcd_master_cert_list|d([]) }}"
  17. - name: sync_etcd_certs | Set facts for etcd sync_file results
  18. set_fact:
  19. etcd_master_certs_needed: "{{ etcd_master_certs_needed|default([]) + [item.path] }}"
  20. with_items: "{{ sync_file_results|d([]) }}"
  21. when: item.no_srcs|bool
  22. - name: sync_etcd_certs | Unset sync_file_results after etcd certs sync
  23. set_fact:
  24. sync_file_results: []
  25. - include: ../../vault/tasks/shared/sync_file.yml
  26. vars:
  27. sync_file: ca.pem
  28. sync_file_dir: "{{ etcd_cert_dir }}"
  29. sync_file_hosts: "{{ groups.etcd }}"
  30. - name: sync_etcd_certs | Unset sync_file_results after ca.pem sync
  31. set_fact:
  32. sync_file_results: []