Skip to content

Commit

Permalink
Update master branch (elastic#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
liza-mae authored Feb 5, 2019
1 parent 2c85e4d commit 6499266
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@
src: '{{ elasticsearch_package }}'
dest: '{{ elasticsearch_install_dir }}'
remote_src: True
tags: install_elasticsearch
list_files: yes
register: archive_contents

- name: Rename directory if it does not match base package name
command:
mv '{{ archive_contents.files[0].split('/')[0] }}' '{{ elasticsearch_rootdir | basename }}'
args:
chdir: '{{ elasticsearch_install_dir}}'
when: "'{{ elasticsearch_rootdir | basename }}' not in '{{ archive_contents.files[0].split('/')[0] }}'"
2 changes: 1 addition & 1 deletion ansible/roles/kibana/tasks/linux/kibana_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
internal_kibana_config_params: |
server.host: {{ current_host_ip }}
logging.dest: {{ kibana_log_file | trim }}
elasticsearch.url: http://{{ current_host_ip }}:{{ elasticsearch_port }}
elasticsearch.hosts: http://{{ current_host_ip }}:{{ elasticsearch_port }}
- name: Add kibana configuration parameters
blockinfile:
path: '{{ kibana_config_file }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
marker: '# {mark} ANSIBLE MANAGED BLOCK KIBANA XPACK PARAMETERS'
insertafter: EOF
content: |
elasticsearch.url: "https://{{ current_host_ip }}:{{ elasticsearch_port }}"
elasticsearch.hosts: "https://{{ current_host_ip }}:{{ elasticsearch_port }}"
elasticsearch.username: {{ kibana_username }}
elasticsearch.password: {{ kibana_password }}
server.ssl.enabled: true
Expand Down
2 changes: 1 addition & 1 deletion playbooks/stack_testing/install_xpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
- { role: xpack_metricbeat, ait_role: xpack_metricbeat_install_config_start_verify_import_dashboards }
- { role: xpack_packetbeat, ait_role: xpack_packetbeat_install_config_start_verify_import_dashboards }
- { role: xpack_apm_server, ait_role: xpack_apm_server_install_config_start_verify_import_dashboards }
- { role: xpack_heartbeat, ait_role: xpack_heartbeat_install_config_start_verify_import_dashboards }
- { role: xpack_heartbeat, ait_role: xpack_heartbeat_install_config_start_verify }
- { role: xpack_auditbeat, ait_role: xpack_auditbeat_install_config_start_verify_import_dashboards }
22 changes: 9 additions & 13 deletions scripts/python/lib/es_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,14 @@ def __init__(self, upgrade=False):
@property
def elasticsearch_package_url(self):
if self._msi_ext:
return self._get_url(self._env_elasticsearch_url, 'elasticsearch', parent_name='windows-installers/elasticsearch', ext='msi')
return self._get_url(self._env_elasticsearch_url, 'elasticsearch')
url = self._get_url(self._env_elasticsearch_url, 'elasticsearch', parent_name='windows-installers/elasticsearch', ext='msi')
if url:
return url
return self._get_url_arch(self._env_elasticsearch_url, 'elasticsearch', parent_name='windows-installers/elasticsearch', ext='msi')
url = self._get_url(self._env_elasticsearch_url, 'elasticsearch')
if url:
return url
return self._get_url_arch(self._env_elasticsearch_url, 'elasticsearch')

@property
def kibana_package_url(self):
Expand Down Expand Up @@ -236,25 +242,15 @@ def architecture(self):
return translate_arch.get(platform + ' ' + ext + ' ' + arch, '')

def ping(self, url):
invalid_url = False
try:
r = requests.head(url)
if r.status_code == 200:
return True
if 'x-pack' not in url:
print('Invalid URL: ' + url)
print('Status code: ' + str(r.status_code))
# Retry the invalid URL
for i in range(5):
r = requests.head(url)
print('RETRYING...Status code: ' + str(r.status_code))
if r.status_code == 200:
return True
time.sleep(1)
invalid_url = True
except:
raise Exception('Error! Unreachable URL: ' + url)
if invalid_url:
raise Exception('Error! Invalid URL: ' + url)
return False

def _get_url(self, specific_url, name, parent_name='', ext=''):
Expand Down

0 comments on commit 6499266

Please sign in to comment.