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

Commit

Permalink
fix files mode syntax
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jmlrt committed Nov 28, 2019
1 parent 73050e1 commit 3c6b822
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions tasks/elasticsearch-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
state: directory
owner: root
group: "{{ es_group }}"
mode: 2750
mode: "2750"

#Create pid directory
- name: Create PID Directory
Expand All @@ -19,7 +19,7 @@
state: directory
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 0755
mode: "755"

#Create required directories
- name: Create Others Directories
Expand All @@ -29,7 +29,7 @@
state: directory
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 2750
mode: "2750"
with_items:
- "{{ es_log_dir }}"
- "{{ es_data_dirs }}"
Expand All @@ -42,7 +42,7 @@
dest: "{{ es_conf_dir }}/elasticsearch.yml"
owner: root
group: "{{ es_group }}"
mode: 0660
mode: "660"
force: yes
register: system_change
notify: restart elasticsearch
Expand All @@ -55,7 +55,7 @@
dest: "{{ default_file }}"
owner: root
group: "{{ es_group }}"
mode: 0660
mode: "660"
force: yes
notify: restart elasticsearch

Expand All @@ -67,15 +67,15 @@
file:
path: "{{ sysd_config_file | dirname }}"
state: directory
mode: 0755
mode: "755"

- name: Copy specific ElasticSearch Systemd config file
ini_file:
path: "{{ sysd_config_file }}"
section: Service
option: LimitMEMLOCK
value: infinity
mode: 0644
mode: "644"
notify:
- reload systemd configuration
- restart elasticsearch
Expand All @@ -87,7 +87,7 @@
dest: "{{ es_conf_dir }}/jvm.options"
owner: root
group: "{{ es_group }}"
mode: 0660
mode: "660"
force: yes
notify: restart elasticsearch

Expand All @@ -98,7 +98,7 @@
dest: "{{ es_conf_dir }}/log4j2.properties"
owner: root
group: "{{ es_group }}"
mode: 0660
mode: "660"
force: yes
notify: restart elasticsearch
when: es_config_log4j2 != ''
10 changes: 5 additions & 5 deletions tasks/elasticsearch-ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
state: directory
owner: root
group: "{{ es_group }}"
mode: 0750
mode: "750"

- name: Upload SSL/TLS keystore
copy:
src: "{{ es_ssl_keystore }}"
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 0640
mode: "640"
when: es_ssl_keystore and es_ssl_truststore
notify: restart elasticsearch
register: copy_keystore
Expand All @@ -32,7 +32,7 @@
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_truststore | basename }}"
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 0640
mode: "640"
when: es_ssl_keystore and es_ssl_truststore
notify: restart elasticsearch
register: copy_truststore
Expand All @@ -43,7 +43,7 @@
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 0640
mode: "640"
with_items:
- "{{ es_ssl_key }}"
- "{{ es_ssl_certificate }}"
Expand All @@ -58,7 +58,7 @@
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: 0640
mode: "640"
#Restart if this changes
notify: restart elasticsearch
when: es_ssl_certificate_authority | bool
Expand Down
2 changes: 1 addition & 1 deletion tasks/elasticsearch-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
state: directory
owner: root
group: "{{ es_group }}"
mode: 2750
mode: "2750"

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

0 comments on commit 3c6b822

Please sign in to comment.