Scripts and Templates to use default files directory

This commit is contained in:
Dale McDiarmid 2016-03-21 13:21:35 +00:00
parent b8a077e8bd
commit cea57cdd73
4 changed files with 14 additions and 6 deletions

1
.gitignore vendored
View file

@ -1,5 +1,4 @@
.kitchen/ .kitchen/
.kitchen.local.yml
*.lock *.lock
.vendor .vendor
.bundle .bundle

View file

@ -56,13 +56,13 @@
#Copy the instance specific init file #Copy the instance specific init file
- name: Copy Debian Init File for Instance - name: Copy Debian Init File for Instance
template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian' and not use_system_d
notify: restart elasticsearch notify: restart elasticsearch
#Copy the instance specific init file #Copy the instance specific init file
- name: Copy Redhat Init File for Instance - name: Copy Redhat Init File for Instance
template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat' and not use_system_d
notify: restart elasticsearch notify: restart elasticsearch
#Copy the systemd specific file if systemd is installed #Copy the systemd specific file if systemd is installed

View file

@ -7,8 +7,11 @@
- name: Create script dir - name: Create script dir
file: state=directory path={{ es_script_dir }} owner={{ es_user }} group={{ es_group }} file: state=directory path={{ es_script_dir }} owner={{ es_user }} group={{ es_group }}
when: es_config['path.scripts'] is defined
- name: Copy default scripts to elasticsearch
copy: src=scripts dest={{ es_script_dir }} owner={{ es_user }} group={{ es_group }}
when: es_scripts_fileglob is not defined
- name: Copy scripts to elasticsearch - name: Copy scripts to elasticsearch
copy: src={{ item }} dest={{ es_script_dir }} owner={{ es_user }} group={{ es_group }} copy: src={{ item }} dest={{ es_script_dir }} owner={{ es_user }} group={{ es_group }}
with_fileglob: es_scripts_fileglob | default("scripts") with_fileglob: es_scripts_fileglob

View file

@ -1,8 +1,14 @@
--- ---
- file: path=/etc/elasticsearch/templates state=directory owner={{ es_user }} group={{ es_group }}
- name: Copy default templates to elasticsearch
copy: src=templates dest=/etc/elasticsearch/ owner={{ es_user }} group={{ es_group }}
when: es_templates_fileglob is not defined
- name: Copy templates to elasticsearch - name: Copy templates to elasticsearch
copy: src={{ item }} dest=/etc/elasticsearch/ owner={{ es_user }} group={{ es_group }} copy: src={{ item }} dest=/etc/elasticsearch/ owner={{ es_user }} group={{ es_group }}
with_fileglob: es_templates_fileglob | default("templates") with_fileglob: es_templates_fileglob
- set_fact: http_port=9200 - set_fact: http_port=9200