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
1.2 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-" + inventory_hostname + ".pem",
  7. "member-" + inventory_hostname + ".pem"
  8. ] }}
  9. - include_tasks: ../../vault/tasks/shared/sync_file.yml
  10. vars:
  11. sync_file: "{{ item }}"
  12. sync_file_dir: "{{ etcd_cert_dir }}"
  13. sync_file_hosts: [ "{{ inventory_hostname }}" ]
  14. sync_file_is_cert: true
  15. with_items: "{{ etcd_master_cert_list|d([]) }}"
  16. - name: sync_etcd_certs | Set facts for etcd sync_file results
  17. set_fact:
  18. etcd_master_certs_needed: "{{ etcd_master_certs_needed|default([]) + [item.path] }}"
  19. with_items: "{{ sync_file_results|d([]) }}"
  20. when: item.no_srcs|bool
  21. - name: sync_etcd_certs | Unset sync_file_results after etcd certs sync
  22. set_fact:
  23. sync_file_results: []
  24. - include_tasks: ../../vault/tasks/shared/sync_file.yml
  25. vars:
  26. sync_file: ca.pem
  27. sync_file_dir: "{{ etcd_cert_dir }}"
  28. sync_file_hosts: [ "{{ inventory_hostname }}" ]
  29. - name: sync_etcd_certs | Unset sync_file_results after ca.pem sync
  30. set_fact:
  31. sync_file_results: []