Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

es_custom_package_url is undocumented #496

Closed
dawi opened this issue Sep 18, 2018 · 3 comments
Closed

es_custom_package_url is undocumented #496

dawi opened this issue Sep 18, 2018 · 3 comments

Comments

@dawi
Copy link

dawi commented Sep 18, 2018

The variable es_custom_package_url is undocumented.

Is it safe to be used?

@Crazybus
Copy link
Contributor

Is it safe to be used?

Yes. I'll add in some documentation for it now. The TL;DR is that you should also set es_use_repository: false when setting it.

- name: use the custom package url instead of the repository
set_fact:
es_custom_package_url: "{{ snapshots.json['packages'][package_name]['url'] }}"
es_use_repository: false

@dawi
Copy link
Author

dawi commented Sep 18, 2018

UPDATE

@Crazybus You were to fast. :) I wrote the comment below at the same time. :)

Original Comment:

To install elasticsearch from a custom package url, es_version and es_use_repository must also be set.

Example:

es_version: 5.6.2
es_use_repository: false
es_custom_package_url: "https://.../elasticsearch-5.6.2.deb"

It would be nice to set es_use_repository automatically to false if someone want's to specify the exact package via url. Also it would be nice to determine the es_version from the package to install.

@Crazybus
Copy link
Contributor

It would be nice to set es_use_repository automatically to false if someone want's to specify the exact package via url.

Agreed. It's silly to manually do it if it always needs to be done.

Also it would be nice to determine the es_version from the package to install.

This one is a bit trickier since you can't expect the custom url to always have the version in it. And if it does it would be hard to determine which version like string it actually is. You might also have multiple version like numbers in the url like https://downloads.example.com/2018.11.01/6.4/6.4.0.

To make your code more dry I would suggest doing something like:

es_version: 5.6.2
es_use_repository: false
es_custom_package_url: "https://.../elasticsearch-{{ es_version }}.deb"

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants