Add always tags to set_fact tasks

Small correction to `when` clause in `tasks/elasticsearch-plugins.yml`.
This commit is contained in:
Jonathan Strootman 2016-04-26 12:11:13 -07:00
parent aa129e4eb4
commit 87bbff5279
6 changed files with 41 additions and 1 deletions

View file

@ -11,19 +11,31 @@
- set_fact: use_system_d={{(ansible_distribution == 'Debian' and ansible_distribution_version | version_compare('8', '>=')) or (ansible_distribution == 'CentOS' and ansible_distribution_version | version_compare('7', '>=')) or (ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('15', '>=')) }}
tags:
- always
- set_fact: instance_sysd_script={{sysd_script | dirname }}/{{es_instance_name}}_{{sysd_script | basename}}
when: use_system_d
tags:
- always
#For directories we also use the {{inventory_hostname}}-{{ es_instance_name }} - this helps if we have a shared SAN.
- set_fact: instance_suffix={{inventory_hostname}}-{{ es_instance_name }}
tags:
- always
- set_fact: pid_dir={{ es_pid_dir }}/{{instance_suffix}}
tags:
- always
- set_fact: log_dir={{ es_log_dir }}/{{instance_suffix}}
tags:
- always
- set_fact: work_dir={{ es_work_dir }}/{{instance_suffix}}
tags:
- always
#Create required directories
- name: Create Directories
@ -36,6 +48,8 @@
- "{{plugin_dir}}"
- set_fact: data_dirs={{ es_data_dirs | append_to_list('/'+instance_suffix) }}
tags:
- always
- name: Create Data Directories
file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }}

View file

@ -2,11 +2,17 @@
#es_plugins_reinstall will be set to true if elasticsearch_install.changed i.e. we have changed ES version, or if no plugins listed. Otherwise it is false and requires explicitly setting.
- set_fact: es_plugins_reinstall=true
when: elasticsearch_install.changed or es_plugins is not defined or es_plugins is none
when: (elasticsearch_install is defined and elasticsearch_install.changed) or es_plugins is not defined or es_plugins is none
tags:
- always
- set_fact: list_command="list"
tags:
- always
- set_fact: list_command="--list"
when: es_version | version_compare('2.0', '<')
tags:
- always
#List currently installed plugins
- shell: "{{es_home}}/bin/plugin {{list_command}} | sed -n '1!p' | cut -d '-' -f2-"

View file

@ -1,9 +1,13 @@
---
- set_fact: es_script_dir={{ es_conf_dir }}/{{es_instance_name}}
tags:
- always
- set_fact: es_script_dir={{es_config['path.scripts']}}
when: es_config['path.scripts'] is defined
tags:
- always
- name: Create script dir
file: state=directory path={{ es_script_dir }} owner={{ es_user }} group={{ es_group }}

View file

@ -11,9 +11,13 @@
with_fileglob: "{{ es_templates_fileglob }}"
- set_fact: http_port=9200
tags:
- always
- set_fact: http_port={{es_config['http.port']}}
when: es_config['http.port'] is defined
tags:
- always
- name: Wait for elasticsearch to startup
wait_for: port={{http_port}} delay=10

View file

@ -1,10 +1,20 @@
---
- set_fact: instance_default_file={{default_file | dirname}}/{{es_instance_name}}_{{default_file | basename}}
tags:
- always
- set_fact: instance_init_script={{init_script | dirname }}/{{es_instance_name}}_{{init_script | basename}}
tags:
- always
- set_fact: conf_dir={{ es_conf_dir }}/{{es_instance_name}}
tags:
- always
- set_fact: plugin_dir={{ es_plugin_dir }}/{{es_instance_name}}
tags:
- always
- set_fact: m_lock_enabled={{ es_config['bootstrap.mlockall'] is defined and es_config['bootstrap.mlockall'] == True }}
tags:
- always
- debug: msg="Node configuration {{ es_config }} "

View file

@ -5,6 +5,8 @@
- check
- name: os-specific vars
include_vars: "{{ansible_os_family}}.yml"
tags:
- always
- include: java.yml
tags:
- java