Created
January 26, 2021 16:24
-
-
Save wilpig/0fb0e2b46df77f5454c8454f380fb356 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this to install elasticsearch | |
# | |
# Optional Parameters: | |
# | |
# | |
# | |
# USAGE EXAMPLES | |
# | |
# Simple | |
# | |
# - include_tasks: ../../app/elasticsearch/elasticsearch.yml | |
# | |
# | |
--- | |
- name: Enable Elastic Search repo | |
rhsm_repository: | |
name: vumc_it_linux_Elastic_Elasticsearch_7 | |
state: enabled | |
- name: Install packages | |
package: | |
name: "{{ packages }}" | |
state: present | |
lock_timeout: 180 # wait up to 3 minutes for a lock ansible/ansible#57189 | |
vars: | |
packages: | |
['elasticsearch'] | |
- include_tasks: ../../common/sudoers.yml | |
vars: | |
service: 'elasticsearch' | |
# filename: 30_elasticsearch_cmds | |
# commands: [] | |
- include_tasks: ../../common/perms.yml | |
vars: | |
username: '{{ l_item.username |default("root") }}' | |
group: '{{ l_item.group |default("elasticsearch") }}' | |
filemode: '{{ l_item.filemode |default("") }}' | |
dirmode: '{{ l_item.dirmode |default("") }}' | |
dironly: '{{ l_item.dironly |default("") }}' | |
recurse: '{{ l_item.recurse |default("") }}' | |
path: '{{ l_item.path }}' | |
excludes: '{{ l_item.excludes |default("") }}' | |
loop_control: | |
loop_var: l_item | |
loop: | |
# https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html#rpm-configuring | |
# options say this path needs setgid flag set, verify | |
- { path: '/etc/elasticsearch', username: '{{ username }}', filemode: '0640' } | |
- { path: '/etc/sysconfig/elasticsearch', username: '{{ username }}', filemode: '0640' } | |
# log path, give access? | |
- { path: '/var/log/elasticsearch', username: '{{ username }}', dironly: 'yes' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment