main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. - name: Consul installed
  3. community.general.pkgng:
  4. name: "consul"
  5. state: latest
  6. tags:
  7. - dc1
  8. - dc2
  9. - name: Consul enabled
  10. shell: sysrc consul_enable="YES"
  11. tags:
  12. - dc1
  13. - dc2
  14. notify: Consul restarted
  15. - name: Consul syslog output
  16. shell: sysrc consul_syslog_output_enable="YES"
  17. tags:
  18. - dc1
  19. - dc2
  20. notify: Consul restarted
  21. - name: Consul dc1 nodes configured
  22. shell: sysrc consul_args="-server -client 0.0.0.0 -ui -bootstrap-expect=3 -datacenter dc1 -retry-join-wan nomad11.local -retry-join nomad00.local -retry-join nomad01.local -retry-join nomad02.local -retry-join nomad03.local"
  23. tags:
  24. - dc1
  25. notify: Consul restarted
  26. - name: Consul dc2 nodes configured
  27. shell: sysrc consul_args="-server -client 0.0.0.0 -ui -bootstrap-expect=3 -datacenter dc2 -retry-join-wan nomad01.local -retry-join nomad10.local -retry-join nomad11.local -retry-join nomad12.local -retry-join nomad13.local"
  28. tags:
  29. - dc2
  30. notify: Consul restarted
  31. - name: Consul dc1 agent configured
  32. shell: sysrc consul_args="-datacenter dc1 -retry-join consul.service.dc1.consul"
  33. tags:
  34. - dc1-agents
  35. notify: Consul restarted
  36. - name: Consul dc2 agent configured
  37. shell: sysrc consul_args="-datacenter dc2 -retry-join consul.service.dc2.consul"
  38. tags:
  39. - dc1-agents
  40. notify: Consul restarted
  41. - name: Consul started
  42. service: name=consul state=started
  43. tags:
  44. - dc1
  45. - dc2