Skip to content

Commit bc7fc40

Browse files
committed
fix files mode syntax
From Ansible doc (https://docs.ansible.com/ansible/latest/modules/template_module.html#template-module) For those used to /usr/bin/chmod remember that modes are actually octal numbers. You must either add a leading zero so that Ansible's YAML parser knows it is an octal number (like 0644 or 01777) or quote it (like '644' or '1777') so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results.
1 parent 1dbbda6 commit bc7fc40

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

tasks/elasticsearch-config.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
state: directory
1010
owner: root
1111
group: "{{ es_group }}"
12-
mode: 2750
12+
mode: "2750"
1313

1414
#Create pid directory
1515
- name: Create PID Directory
@@ -19,7 +19,7 @@
1919
state: directory
2020
owner: "{{ es_user }}"
2121
group: "{{ es_group }}"
22-
mode: 0755
22+
mode: "755"
2323

2424
#Create required directories
2525
- name: Create Others Directories
@@ -29,7 +29,7 @@
2929
state: directory
3030
owner: "{{ es_user }}"
3131
group: "{{ es_group }}"
32-
mode: 2750
32+
mode: "2750"
3333
with_items:
3434
- "{{ es_log_dir }}"
3535
- "{{ es_data_dirs }}"
@@ -42,7 +42,7 @@
4242
dest: "{{ es_conf_dir }}/elasticsearch.yml"
4343
owner: root
4444
group: "{{ es_group }}"
45-
mode: 0660
45+
mode: "660"
4646
force: yes
4747
register: system_change
4848
notify: restart elasticsearch
@@ -55,7 +55,7 @@
5555
dest: "{{ default_file }}"
5656
owner: root
5757
group: "{{ es_group }}"
58-
mode: 0660
58+
mode: "660"
5959
force: yes
6060
notify: restart elasticsearch
6161

@@ -67,15 +67,15 @@
6767
file:
6868
path: "{{ sysd_config_file | dirname }}"
6969
state: directory
70-
mode: 0755
70+
mode: "755"
7171

7272
- name: Copy specific ElasticSearch Systemd config file
7373
ini_file:
7474
path: "{{ sysd_config_file }}"
7575
section: Service
7676
option: LimitMEMLOCK
7777
value: infinity
78-
mode: 0644
78+
mode: "644"
7979
notify:
8080
- reload systemd configuration
8181
- restart elasticsearch
@@ -87,7 +87,7 @@
8787
dest: "{{ es_conf_dir }}/jvm.options"
8888
owner: root
8989
group: "{{ es_group }}"
90-
mode: 0660
90+
mode: "660"
9191
force: yes
9292
notify: restart elasticsearch
9393

@@ -98,7 +98,7 @@
9898
dest: "{{ es_conf_dir }}/log4j2.properties"
9999
owner: root
100100
group: "{{ es_group }}"
101-
mode: 0660
101+
mode: "660"
102102
force: yes
103103
notify: restart elasticsearch
104104
when: es_config_log4j2 != ''

tasks/elasticsearch-ssl.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
state: directory
1414
owner: root
1515
group: "{{ es_group }}"
16-
mode: 0750
16+
mode: "750"
1717

1818
- name: Upload SSL/TLS keystore
1919
copy:
2020
src: "{{ es_ssl_keystore }}"
2121
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
2222
owner: "{{ es_user }}"
2323
group: "{{ es_group }}"
24-
mode: 0640
24+
mode: "640"
2525
when: es_ssl_keystore and es_ssl_truststore
2626
notify: restart elasticsearch
2727
register: copy_keystore
@@ -32,7 +32,7 @@
3232
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_truststore | basename }}"
3333
owner: "{{ es_user }}"
3434
group: "{{ es_group }}"
35-
mode: 0640
35+
mode: "640"
3636
when: es_ssl_keystore and es_ssl_truststore
3737
notify: restart elasticsearch
3838
register: copy_truststore
@@ -43,7 +43,7 @@
4343
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
4444
owner: "{{ es_user }}"
4545
group: "{{ es_group }}"
46-
mode: 0640
46+
mode: "640"
4747
with_items:
4848
- "{{ es_ssl_key }}"
4949
- "{{ es_ssl_certificate }}"
@@ -58,7 +58,7 @@
5858
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
5959
owner: "{{ es_user }}"
6060
group: "{{ es_group }}"
61-
mode: 0640
61+
mode: "640"
6262
#Restart if this changes
6363
notify: restart elasticsearch
6464
when: es_ssl_certificate_authority | bool

tasks/elasticsearch-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
state: directory
77
owner: root
88
group: "{{ es_group }}"
9-
mode: 2750
9+
mode: "2750"
1010

1111
- name: Copy templates to elasticsearch
1212
copy: src={{ item }} dest={{ es_conf_dir }}/templates owner=root group={{ es_group }} mode=0660

0 commit comments

Comments
 (0)