diff --git a/roles/elasticsearch/tasks/elasticsearch-security.yml b/roles/elasticsearch/tasks/elasticsearch-security.yml index 3f5fcc75..58b3725e 100644 --- a/roles/elasticsearch/tasks/elasticsearch-security.yml +++ b/roles/elasticsearch/tasks/elasticsearch-security.yml @@ -77,6 +77,7 @@ path: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') | dirname }}/ca.crt" register: elasticsearch_check_temporary_ca delegate_to: localhost + become: false - name: Move temporary ca file on Ansible controler ansible.builtin.copy: @@ -85,6 +86,7 @@ mode: preserve when: elasticsearch_check_temporary_ca.stat.exists delegate_to: localhost + become: false register: elasticsearch_move_ca_file - name: Remove temporary ca file on Ansible controler @@ -93,6 +95,7 @@ state: absent when: elasticsearch_move_ca_file.changed delegate_to: localhost + become: false - name: Ensure elasticsearch certificate exists ansible.builtin.stat: @@ -179,6 +182,7 @@ - name: Backup elasticsearch cert on localhost then remove when: "'renew_es_cert' in ansible_run_tags or 'renew_ca' in ansible_run_tags or elasticsearch_cert_will_expire_soon | bool" delegate_to: localhost + become: false tags: - renew_es_cert - renew_ca