You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
2 years ago
|
- name: Start rest of netmaker-services
|
||
|
command: "docker-compose --project-directory /opt/netmaker_server/ up -d"
|
||
|
register: command
|
||
|
failed_when: command.rc != 0
|
||
|
|
||
|
- name: Wait for netmaker-api to become available
|
||
2 years ago
|
uri:
|
||
|
url: 'https://{{ netmaker_api.host }}.{{ netmaker_base_domain }}:{{ netmaker_nginx.advertise_port }}'
|
||
|
return_content: yes
|
||
|
validate_certs: no
|
||
|
status_code:
|
||
|
- 404
|
||
|
until: uri_output.status == 404
|
||
|
retries: 24 # Retries for 24 * 5 seconds = 120 seconds = 2 minutes
|
||
|
delay: 5 # Every 5 seconds
|
||
|
register: uri_output
|
||
|
|
||
|
# todo: check if exists?
|
||
2 years ago
|
|
||
|
- name: Create default mesh-network 'server'
|
||
|
uri:
|
||
2 years ago
|
validate_certs: no
|
||
|
url: 'https://{{ netmaker_api.host }}.{{ netmaker_base_domain }}:{{ netmaker_nginx.advertise_port }}/api/networks'
|
||
2 years ago
|
method: POST
|
||
|
body:
|
||
2 years ago
|
netid: servnet
|
||
2 years ago
|
addressrange: 10.92.0.0/24
|
||
|
addressrange6: fd92::/64
|
||
|
body_format: json
|
||
|
headers:
|
||
2 years ago
|
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
||
|
Content-Type: application/json
|
||
2 years ago
|
when: "inventory_hostname == groups['netmaker_server'][0]"
|
||
2 years ago
|
register: default_mesh
|
||
|
until: "default_mesh is not failed"
|
||
|
retries: 2
|
||
|
delay: 10
|
||
|
|
||
|
# todo: check if exists?
|
||
|
|
||
|
- name: Create token for default-network
|
||
|
uri:
|
||
|
validate_certs: no
|
||
|
url: 'https://{{ netmaker_api.host }}.{{ netmaker_base_domain }}:{{ netmaker_nginx.advertise_port }}/api/networks/servnet/keys' # todo: do implementation
|
||
|
method: POST
|
||
|
body:
|
||
|
name: ""
|
||
|
uses: 0
|
||
|
body_format: json
|
||
|
headers:
|
||
|
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
||
2 years ago
|
Content-Type: application/json
|
||
2 years ago
|
when: "inventory_hostname == groups['netmaker_server'][0]"
|
||
2 years ago
|
register: default_mesh_key
|
||
|
until: "default_mesh_key is not failed"
|
||
2 years ago
|
retries: 2
|
||
|
delay: 10
|