From 2d3877ea82d7635f981e5f6c82c83f298b425e0c Mon Sep 17 00:00:00 2001 From: Keshav Prasad Date: Thu, 8 Sep 2022 15:08:17 +0530 Subject: [PATCH] fix: updated vars and uri module --- ansible/provision-log-es.yml | 6 ++++-- ansible/roles/log-es6/tasks/plugins/create-keystore.yml | 4 ++-- ansible/roles/log-es6/tasks/plugins/repository-azure.yml | 4 ++-- ansible/roles/log-es6/tasks/plugins/repository-gcs.yml | 8 ++++---- ansible/roles/log-es6/tasks/plugins/repository-s3.yml | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ansible/provision-log-es.yml b/ansible/provision-log-es.yml index edd4a416e5..51262b685a 100644 --- a/ansible/provision-log-es.yml +++ b/ansible/provision-log-es.yml @@ -46,5 +46,7 @@ method: PUT return_content: true timeout: 30 - retries: 3 - delay: 10 + register: _result + until: _result.status == 200 + retries: 3 + delay: 10 \ No newline at end of file diff --git a/ansible/roles/log-es6/tasks/plugins/create-keystore.yml b/ansible/roles/log-es6/tasks/plugins/create-keystore.yml index 656183902d..80d2ca536e 100644 --- a/ansible/roles/log-es6/tasks/plugins/create-keystore.yml +++ b/ansible/roles/log-es6/tasks/plugins/create-keystore.yml @@ -2,12 +2,12 @@ - name: Check if elasticsearch keystore exists or not become: yes stat: - path: "{{ conf_dir }}/elasticsearch.keystore" + path: "{{ es_conf_dir }}/elasticsearch.keystore" register: elasticsearch_keystore_file - name: Create the elasticsearch keystore if not exists become: yes command: "{{es_home}}/bin/elasticsearch-keystore create" environment: - ES_PATH_CONF: "{{ conf_dir }}" + ES_PATH_CONF: "{{ es_conf_dir }}" when: elasticsearch_keystore_file.stat.exists == false diff --git a/ansible/roles/log-es6/tasks/plugins/repository-azure.yml b/ansible/roles/log-es6/tasks/plugins/repository-azure.yml index 170a84000e..9c3b9d3774 100644 --- a/ansible/roles/log-es6/tasks/plugins/repository-azure.yml +++ b/ansible/roles/log-es6/tasks/plugins/repository-azure.yml @@ -4,7 +4,7 @@ shell: echo "{{ azure_management_storage_account_name }}" | {{ es_home }}/bin/elasticsearch-keystore add -f azure.client.default.account no_log: True environment: - ES_PATH_CONF: "{{ conf_dir }}" + ES_PATH_CONF: "{{ es_conf_dir }}" - name: Add default azure account key for backups @@ -12,4 +12,4 @@ shell: echo "{{ azure_management_storage_account_key }}" | {{ es_home }}/bin/elasticsearch-keystore add -f azure.client.default.key no_log: True environment: - ES_PATH_CONF: "{{ conf_dir }}" \ No newline at end of file + ES_PATH_CONF: "{{ es_conf_dir }}" \ No newline at end of file diff --git a/ansible/roles/log-es6/tasks/plugins/repository-gcs.yml b/ansible/roles/log-es6/tasks/plugins/repository-gcs.yml index 7d5c32e52e..81078e173d 100644 --- a/ansible/roles/log-es6/tasks/plugins/repository-gcs.yml +++ b/ansible/roles/log-es6/tasks/plugins/repository-gcs.yml @@ -2,17 +2,17 @@ - name: Create the gcs service account file from variable become: yes copy: - dest: "{{ conf_dir }}/gcs_management_bucket_service_account.json" + dest: "{{ es_conf_dir }}/gcs_management_bucket_service_account.json" content: "{{ gcs_management_bucket_service_account }}" - name: Add gcs service account file to keystore become: yes - shell: "{{ es_home }}/bin/elasticsearch-keystore add-file -f gcs.client.default.credentials_file {{ conf_dir }}/gcs_management_bucket_service_account.json" + shell: "{{ es_home }}/bin/elasticsearch-keystore add-file -f gcs.client.default.credentials_file {{ es_conf_dir }}/gcs_management_bucket_service_account.json" no_log: True environment: - ES_PATH_CONF: "{{ conf_dir }}" + ES_PATH_CONF: "{{ es_conf_dir }}" - name: Remove the service account file file: - path: "{{ conf_dir }}/gcs_management_bucket_service_account.json" + path: "{{ es_conf_dir }}/gcs_management_bucket_service_account.json" state: absent \ No newline at end of file diff --git a/ansible/roles/log-es6/tasks/plugins/repository-s3.yml b/ansible/roles/log-es6/tasks/plugins/repository-s3.yml index b5897792ab..344af29e6e 100644 --- a/ansible/roles/log-es6/tasks/plugins/repository-s3.yml +++ b/ansible/roles/log-es6/tasks/plugins/repository-s3.yml @@ -4,11 +4,11 @@ shell: echo "{{ aws_management_bucket_user_access_key }}" | {{ es_home }}/bin/elasticsearch-keystore add -f s3.client.default.access_key no_log: True environment: - ES_PATH_CONF: "{{ conf_dir }}" + ES_PATH_CONF: "{{ es_conf_dir }}" - name: Add default aws account key for backups become: yes shell: echo "{{ aws_management_bucket_user_secret_key }}" | {{ es_home }}/bin/elasticsearch-keystore add -f s3.client.default.secret_key no_log: True environment: - ES_PATH_CONF: "{{ conf_dir }}" + ES_PATH_CONF: "{{ es_conf_dir }}"