From 6a3c32f30618c52c62c4d4fcf6a1da11216713f2 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:23 -0400 Subject: [PATCH] Use local CLI command instead of API to init --- roles/pvc/tasks/pvc/bootstrap.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/roles/pvc/tasks/pvc/bootstrap.yml b/roles/pvc/tasks/pvc/bootstrap.yml index 2908c51..f092639 100644 --- a/roles/pvc/tasks/pvc/bootstrap.yml +++ b/roles/pvc/tasks/pvc/bootstrap.yml @@ -11,25 +11,12 @@ name: pvcapid.service state: started -- name: use http as the API request scheme - set_fact: - api_uri_scheme: http - 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: wait 5s for daemon to initialize + pause: + seconds: 5 - name: initialize a fresh PVC cluster - uri: - url: "{{ api_uri_scheme }}://{{ pvc_api_listen_address }}:{{ pvc_api_listen_port }}/api/v1/initialize" - method: POST + command: pvc -c local init - name: stop the API daemon service: