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.

66 lines
1.7 KiB

9 years ago
  1. ---
  2. - include_tasks: check_certs.yml
  3. when: cert_management == "script"
  4. tags:
  5. - etcd-secrets
  6. - facts
  7. - include_tasks: "gen_certs_script.yml"
  8. when:
  9. - cert_management |d('script') == "script"
  10. tags:
  11. - etcd-secrets
  12. - include_tasks: upd_ca_trust.yml
  13. tags:
  14. - etcd-secrets
  15. - name: "Gen_certs | Get etcd certificate serials"
  16. command: "openssl x509 -in {{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem -noout -serial"
  17. register: "etcd_client_cert_serial_result"
  18. changed_when: false
  19. when:
  20. - inventory_hostname in groups['k8s_cluster']|union(groups['calico_rr']|default([]))|unique|sort
  21. tags:
  22. - master
  23. - network
  24. - name: Set etcd_client_cert_serial
  25. set_fact:
  26. etcd_client_cert_serial: "{{ etcd_client_cert_serial_result.stdout.split('=')[1] }}"
  27. when:
  28. - inventory_hostname in groups['k8s_cluster']|union(groups['calico_rr']|default([]))|unique|sort
  29. tags:
  30. - master
  31. - network
  32. - include_tasks: "install_{{ etcd_deployment_type }}.yml"
  33. when: is_etcd_master
  34. tags:
  35. - upgrade
  36. - include_tasks: configure.yml
  37. when: is_etcd_master
  38. - include_tasks: refresh_config.yml
  39. when: is_etcd_master
  40. - name: Restart etcd if certs changed
  41. service:
  42. name: etcd
  43. state: restarted
  44. enabled: yes
  45. when: is_etcd_master and etcd_cluster_setup and etcd_secret_changed|default(false)
  46. - name: Restart etcd-events if certs changed
  47. service:
  48. name: etcd-events
  49. state: restarted
  50. enabled: yes
  51. when: is_etcd_master and etcd_events_cluster_setup and etcd_secret_changed|default(false)
  52. # After etcd cluster is assembled, make sure that
  53. # initial state of the cluster is in `existing`
  54. # state instead of `new`.
  55. - include_tasks: refresh_config.yml
  56. when: is_etcd_master