NETWAYS / ansible-collection-elasticstack

A collection to install and manage the Elastic Stack
GNU General Public License v3.0
10 stars 8 forks source link

Enforce repos only with full stack #314

Closed widhalmt closed 7 months ago

widhalmt commented 7 months ago

RPM installation automatically enabled the Elastic Stack repositories this collection will add to a host. But if you have another tool to manage your repositories, they might have other ids and names.

So I added separate installation tasks. If elasticstack_full_stack is set to true, everything stays as it was. The task will forcefully enable the repository and then install the package.

But if elasticstack_full_stack is set to false it will just ignore the repository and expect the package to be available.

While working on this I found a different approach to choosing the correct version in the beats role. I couldn't afford to fix it all in a single PR so I opened #313 for this.

fixes #312

widhalmt commented 7 months ago

I just wanted to start implementing your proposed change @tbauriedel . BUT we already have a variable in the name of the repository (showing the release version). And using variables in variables isn't a great idea in Ansible.

I would change the name of the repo but I guess the current setup is what makes upgrades through major releases easier.

What do you think? Do you have an idea how to work around this?

tbauriedel commented 7 months ago

You could combine the variables to have one. But thats also just a "hacky workaround". elastic_repo: "{{ filename }}-{{ version }}"

I don't like the whole thing right now either. It's all very hacky. But I can't think of a better solution at the moment. Solving the whole thing using a variable would be the cleanest way.

widhalmt commented 7 months ago

That can only work with another extra task assembling the name when the value's empty. Because, if we allow to have arbitraty repo names then we can't make any assumptions about the nomenclature.