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.

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