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.

44 lines
1.7 KiB

  1. ---
  2. - name: Configure | Check if member is in cluster
  3. shell: "etcdctl --peers={{ etcd_access_addresses }} member list | grep -q {{ etcd_access_address }}"
  4. register: etcd_member_in_cluster
  5. ignore_errors: true
  6. changed_when: false
  7. when: is_etcd_master
  8. - name: Configure | Add member to the cluster if it is not there
  9. when: is_etcd_master and etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0
  10. shell: "etcdctl --peers={{ etcd_access_addresses }} member add {{ etcd_member_name }} {{ etcd_peer_url }}"
  11. - name: Configure | Copy etcd.service systemd file
  12. template:
  13. src: "etcd-{{ etcd_deployment_type }}.service.j2"
  14. dest: /etc/systemd/system/etcd.service
  15. backup: yes
  16. when: ansible_service_mgr == "systemd" and is_etcd_master
  17. notify: restart etcd
  18. - name: Configure | Write etcd initd script
  19. template:
  20. src: "deb-etcd-{{ etcd_deployment_type }}.initd.j2"
  21. dest: /etc/init.d/etcd
  22. owner: root
  23. mode: 0755
  24. when: ansible_service_mgr in ["sysvinit","upstart"] and ansible_os_family == "Debian" and is_etcd_master
  25. notify: restart etcd
  26. - name: Configure | Copy etcd-proxy.service systemd file
  27. template:
  28. src: "etcd-proxy-{{ etcd_deployment_type }}.service.j2"
  29. dest: /etc/systemd/system/etcd-proxy.service
  30. backup: yes
  31. when: ansible_service_mgr == "systemd" and is_etcd_proxy
  32. notify: restart etcd-proxy
  33. - name: Configure | Write etcd-proxy initd script
  34. template:
  35. src: "deb-etcd-proxy-{{ etcd_deployment_type }}.initd.j2"
  36. dest: /etc/init.d/etcd-proxy
  37. owner: root
  38. mode: 0755
  39. when: ansible_service_mgr in ["sysvinit","upstart"] and ansible_os_family == "Debian" and is_etcd_proxy
  40. notify: restart etcd-proxy