Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 6b1e5c2

Browse files
committed
Fix permissions of cert directory and files
1 parent 8fb9e81 commit 6b1e5c2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tasks/elasticsearch-ssl.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
file:
1212
dest: "{{ es_ssl_certificate_path }}"
1313
state: directory
14+
owner: root
15+
group: "{{ es_group }}"
16+
mode: 0750
1417

1518
- name: Upload SSL/TLS keystore
1619
copy:
1720
src: "{{ es_ssl_keystore }}"
1821
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
22+
owner: "{{ es_user }}"
23+
group: "{{ es_group }}"
24+
mode: 0640
1925
when: es_ssl_keystore and es_ssl_truststore
2026
notify: restart elasticsearch
2127
register: copy_keystore
@@ -24,6 +30,9 @@
2430
copy:
2531
src: "{{ es_ssl_truststore }}"
2632
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_truststore | basename }}"
33+
owner: "{{ es_user }}"
34+
group: "{{ es_group }}"
35+
mode: 0640
2736
when: es_ssl_keystore and es_ssl_truststore
2837
notify: restart elasticsearch
2938
register: copy_truststore
@@ -32,6 +41,9 @@
3241
copy:
3342
src: "{{ item }}"
3443
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
44+
owner: "{{ es_user }}"
45+
group: "{{ es_group }}"
46+
mode: 0640
3547
with_items:
3648
- "{{ es_ssl_key }}"
3749
- "{{ es_ssl_certificate }}"
@@ -44,6 +56,9 @@
4456
copy:
4557
src: "{{ es_ssl_certificate_authority }}"
4658
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
59+
owner: "{{ es_user }}"
60+
group: "{{ es_group }}"
61+
mode: 0640
4762
#Restart if this changes
4863
notify: restart elasticsearch
4964
when: es_ssl_certificate_authority | bool

0 commit comments

Comments
 (0)