|
|
|
- name: Deploy rqlite config
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: rqlite-config.json.template
|
|
|
|
dest: /opt/netmaker_server/rqlite/config.json
|
|
|
|
|
|
|
|
- name: Start rqlite service for 1st-node
|
|
|
|
command: "docker-compose --project-directory /opt/netmaker_server/ up -d rqlite"
|
|
|
|
register: command
|
|
|
|
failed_when: command.rc != 0
|
|
|
|
when: "inventory_hostname == groups['netmaker_server'][0]"
|
|
|
|
|
|
|
|
- name: Waiting for rqlite to accept connections on 1st-node
|
|
|
|
uri:
|
|
|
|
url: 'https://{{ netmaker_rqlite.http_host }}.{{ inventory_hostname }}:{{ netmaker_nginx.advertise_port }}/status'
|
|
|
|
return_content: yes
|
|
|
|
validate_certs: no
|
|
|
|
status_code:
|
|
|
|
- 401
|
|
|
|
until: uri_output.status == 401
|
|
|
|
retries: 24 # Retries for 24 * 5 seconds = 120 seconds = 2 minutes
|
|
|
|
delay: 5 # Every 5 seconds
|
|
|
|
register: uri_output
|
|
|
|
when: "inventory_hostname == groups['netmaker_server'][0]"
|
|
|
|
|
|
|
|
- name: Start rqlite service for other nodes
|
|
|
|
command: "docker-compose --project-directory /opt/netmaker_server/ up -d rqlite"
|
|
|
|
register: command
|
|
|
|
failed_when: command.rc != 0
|
|
|
|
when: "inventory_hostname != groups['netmaker_server'][0]"
|
|
|
|
|
|
|
|
- name: Waiting for rqlite to accept connections on other nodes
|
|
|
|
uri:
|
|
|
|
url: 'https://{{ netmaker_rqlite.http_host }}.{{ inventory_hostname }}:{{ netmaker_nginx.advertise_port }}/status'
|
|
|
|
return_content: yes
|
|
|
|
validate_certs: no
|
|
|
|
status_code:
|
|
|
|
- 401
|
|
|
|
until: uri_output.status == 401
|
|
|
|
retries: 24 # Retries for 24 * 5 seconds = 120 seconds = 2 minutes
|
|
|
|
delay: 5 # Every 5 seconds
|
|
|
|
register: uri_output
|
|
|
|
when: "inventory_hostname != groups['netmaker_server'][0]"
|