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.

36 lines
1014 B

  1. ---
  2. - name: Configure | Check if member is in cluster
  3. shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ 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. check_mode: no
  8. when: is_etcd_master
  9. tags:
  10. - facts
  11. - name: Install etcd launch script
  12. template:
  13. src: etcd.j2
  14. dest: "{{ bin_dir }}/etcd"
  15. owner: 'root'
  16. mode: 0755
  17. backup: yes
  18. notify: restart etcd
  19. - name: Configure | Copy etcd.service systemd file
  20. template:
  21. src: "etcd-{{ etcd_deployment_type }}.service.j2"
  22. dest: /etc/systemd/system/etcd.service
  23. backup: yes
  24. when: is_etcd_master
  25. notify: restart etcd
  26. - name: Configure | Join member(s) to cluster one at a time
  27. include: join_member.yml
  28. vars:
  29. target_node: "{{ item }}"
  30. loop_control:
  31. pause: 10
  32. with_items: "{{ groups['etcd'] }}"
  33. when: inventory_hostname == item and etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0