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.

52 lines
1.4 KiB

9 years ago
  1. ---
  2. - include: check_certs.yml
  3. when: cert_management == "script"
  4. tags: [etcd-secrets, facts]
  5. - include: "gen_certs_{{ cert_management }}.yml"
  6. tags: etcd-secrets
  7. - include: upd_ca_trust.yml
  8. tags: etcd-secrets
  9. - name: "Gen_certs | Get etcd certificate serials"
  10. shell: "openssl x509 -in {{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem -noout -serial | cut -d= -f2"
  11. register: "etcd_client_cert_serial"
  12. when: inventory_hostname in groups['k8s-cluster']|union(groups['etcd'])|union(groups['calico-rr']|default([]))|unique|sort
  13. - include: "install_{{ etcd_deployment_type }}.yml"
  14. when: is_etcd_master
  15. tags: upgrade
  16. - include: set_cluster_health.yml
  17. when: is_etcd_master and etcd_cluster_setup
  18. - include: configure.yml
  19. when: is_etcd_master and etcd_cluster_setup
  20. - include: refresh_config.yml
  21. when: is_etcd_master and etcd_cluster_setup
  22. - name: Restart etcd if certs changed
  23. command: /bin/true
  24. notify: restart etcd
  25. when: is_etcd_master and etcd_secret_changed|default(false)
  26. # reload-systemd
  27. - meta: flush_handlers
  28. - name: Ensure etcd is running
  29. service:
  30. name: etcd
  31. state: started
  32. enabled: yes
  33. when: is_etcd_master and etcd_cluster_setup
  34. # After etcd cluster is assembled, make sure that
  35. # initial state of the cluster is in `existing`
  36. # state insted of `new`.
  37. - include: set_cluster_health.yml
  38. when: is_etcd_master and etcd_cluster_setup
  39. - include: refresh_config.yml
  40. when: is_etcd_master and etcd_cluster_setup