Merge pull request #75 from LaneCommunityCollege/optional_user
For #36 - Add support for creating optional elasticsearch user and group
This commit is contained in:
commit
7d94121017
5 changed files with 35 additions and 1 deletions
18
tasks/elasticsearch-optional-user.yml
Normal file
18
tasks/elasticsearch-optional-user.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
#Add the elasticsearch user before installing from packages.
|
||||
- name: Ensure optional elasticsearch group is created with the correct id.
|
||||
group:
|
||||
state: present
|
||||
name: "{{ es_group }}"
|
||||
system: yes
|
||||
gid: "{{ es_group_id }}"
|
||||
|
||||
- name: Ensure optional elasticsearch user is created with the correct id.
|
||||
user:
|
||||
state: present
|
||||
name: "{{ es_user }}"
|
||||
comment: elasticsearch system user
|
||||
system: yes
|
||||
createhome: no
|
||||
uid: "{{ es_user_id }}"
|
||||
group: "{{ es_group }}"
|
||||
|
|
@ -8,6 +8,10 @@
|
|||
|
||||
- debug: msg="Node configuration {{ es_config }} "
|
||||
|
||||
- name: Include optional user and group creation.
|
||||
when: (es_user_id is defined) and (es_group_id is defined)
|
||||
include: elasticsearch-optional-user.yml
|
||||
|
||||
#- name: Include specific Elasticsearch
|
||||
# include: "elasticsearch-{{ansible_os_family}}.yml"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue