Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce repos only with full stack #314

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

widhalmt
Copy link
Member

@widhalmt widhalmt commented Feb 7, 2024

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

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 widhalmt added the bug Something isn't working label Feb 7, 2024
@widhalmt widhalmt added this to the 1.0.0 milestone Feb 7, 2024
@widhalmt widhalmt requested review from tbauriedel and a team February 7, 2024 15:28
@widhalmt widhalmt self-assigned this Feb 7, 2024
@widhalmt widhalmt enabled auto-merge February 7, 2024 16:15
Copy link
Member

@tbauriedel tbauriedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to have a variable to define the name of the repository?
With that the second "install" task is not needed anymore.

Default should be the name provided by the repos role. If someone wants to use another repository they can define it in this variable.

@widhalmt
Copy link
Member Author

widhalmt commented Feb 8, 2024

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
Copy link
Member

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
Copy link
Member Author

widhalmt commented Feb 9, 2024

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.

@widhalmt widhalmt added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit f3ee73d Feb 9, 2024
6 checks passed
@widhalmt widhalmt deleted the fix/enforce_repos_only_fullstack-312 branch February 9, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Forcfully enabling repository breaks install task on some systems
2 participants