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.8 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. shell: "openssl x509 -in {{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem -noout -serial | cut -d= -f2"
  15. register: "etcd_client_cert_serial_result"
  16. changed_when: false
  17. when: inventory_hostname in groups['k8s-cluster']|union(groups['etcd'])|union(groups['calico-rr']|default([]))|unique|sort
  18. - name: Set etcd_client_cert_serial
  19. set_fact:
  20. etcd_client_cert_serial: "{{ etcd_client_cert_serial_result.stdout }}"
  21. when: inventory_hostname in groups['k8s-cluster']|union(groups['etcd'])|union(groups['calico-rr']|default([]))|unique|sort
  22. - include_tasks: "install_{{ etcd_deployment_type }}.yml"
  23. when: is_etcd_master
  24. tags:
  25. - upgrade
  26. - import_tasks: set_cluster_health.yml
  27. when: is_etcd_master and etcd_cluster_setup
  28. - import_tasks: configure.yml
  29. when: is_etcd_master and etcd_cluster_setup
  30. - import_tasks: refresh_config.yml
  31. when: is_etcd_master and etcd_cluster_setup
  32. - name: Restart etcd if certs changed
  33. command: /bin/true
  34. notify: restart etcd
  35. when: is_etcd_master and etcd_secret_changed|default(false)
  36. # reload-systemd
  37. - meta: flush_handlers
  38. - name: Ensure etcd is running
  39. service:
  40. name: etcd
  41. state: started
  42. enabled: yes
  43. when: is_etcd_master and etcd_cluster_setup
  44. # After etcd cluster is assembled, make sure that
  45. # initial state of the cluster is in `existing`
  46. # state insted of `new`.
  47. - import_tasks: set_cluster_health.yml
  48. when: is_etcd_master and etcd_cluster_setup
  49. - import_tasks: refresh_config.yml
  50. when: is_etcd_master and etcd_cluster_setup