Use local CLI command instead of API to init

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:23 -04:00
parent c71415317a
commit 6a3c32f306
1 changed files with 4 additions and 17 deletions

View File

@ -11,25 +11,12 @@
name: pvcapid.service name: pvcapid.service
state: started state: started
- name: use http as the API request scheme - name: wait 5s for daemon to initialize
set_fact: pause:
api_uri_scheme: http seconds: 5
when: not pvc_api_enable_ssl
- name: use https as the API request scheme
set_fact:
api_uri_scheme: https
when: pvc_api_enable_ssl
- name: use the first API token to initialize cluster
set_fact:
api_uri_token: "{{ pvc_api_tokens[0].token }}"
when: pvc_api_enable_authentication and pvc_api_tokens and pvc_api_tokens[0]
- name: initialize a fresh PVC cluster - name: initialize a fresh PVC cluster
uri: command: pvc -c local init
url: "{{ api_uri_scheme }}://{{ pvc_api_listen_address }}:{{ pvc_api_listen_port }}/api/v1/initialize"
method: POST
- name: stop the API daemon - name: stop the API daemon
service: service: