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.

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