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.

33 lines
1.1 KiB

  1. ---
  2. - name: sync_etcd_node_certs | Create list of node certs needing creation
  3. set_fact:
  4. etcd_node_cert_list: "{{ etcd_node_cert_list|default([]) + ['node-' + inventory_hostname + '.pem'] }}"
  5. - include: ../../vault/tasks/shared/sync_file.yml
  6. vars:
  7. sync_file: "{{ item }}"
  8. sync_file_dir: "{{ etcd_cert_dir }}"
  9. sync_file_hosts: [ "{{ inventory_hostname }}" ]
  10. sync_file_is_cert: true
  11. with_items: "{{ etcd_node_cert_list|d([]) }}"
  12. - name: sync_etcd_node_certs | Set facts for etcd sync_file results
  13. set_fact:
  14. etcd_node_certs_needed: "{{ etcd_node_certs_needed|default([]) + [item.path] }}"
  15. with_items: "{{ sync_file_results|d([]) }}"
  16. when: item.no_srcs|bool
  17. - name: sync_etcd_node_certs | Unset sync_file_results after etcd node certs
  18. set_fact:
  19. sync_file_results: []
  20. - include: ../../vault/tasks/shared/sync_file.yml
  21. vars:
  22. sync_file: ca.pem
  23. sync_file_dir: "{{ etcd_cert_dir }}"
  24. sync_file_hosts: "{{ groups['etcd'] }}"
  25. - name: sync_etcd_node_certs | Unset sync_file_results after ca.pem
  26. set_fact:
  27. sync_file_results: []