-
Notifications
You must be signed in to change notification settings - Fork 163
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
WIP: Foreman interface #792
Conversation
The module looks fine so far. |
4cbd167
to
41f9703
Compare
Thanks! This looks like a very good start! Two questions/concerns:
|
@evgeni I think, that is not a very big problem, because with the ansible modules, creating and starting (in order to install) the host are two separate steps anyway. So it should be easy to let interface creation sneak in. |
Same concern as @evgeni regarding compute resource. Two things to keep in mind:
|
Thanks for the feedback! Second point - yes I share that fear 😛 |
@bagasse thanks also for the points. |
I have some troubles with the module implementation. My testplaybook is firstly creating the well-known test-host from the host module test. Afterwards the first "real" test step should create an additional interface to the already existing one from the test-host.
What it actually does is renaming the existing one, that has the name Looking at the foreman-production log I can also see that the module searches for an interface and then updates that one, rather than creating a new one. The second task is supposed to prove idempotence by not changing anything:
What it does is trying to create a new interface. I can see in the log, that the module is searching via api call for all interfaces of the host, but is not using the name of the interface eg "test-interface` for the search. Am I missing anything in my code regarding the entity resolving? |
I think the issue is, that the interfaces api does not support search, so you always get "all" interfaces for the host (see https://theforeman.org/api/2.0/apidoc/v2/interfaces/index.html) and then you end up replacing the one you got instead of creating a new one (as it never matched the name of the interface) |
@evgeni ok - thanks. that acutally makes sense. However I am not sure I understand it fully.
Whereas this one returns exactly one:
Is the correct approach then to use one of the "manual" entitiy searches (nailgun style?) |
#979 is merged, so I am closing this. |
@evgeni This is a first draft to resolve #757
It is far from being "done" but I'd appreciate your opinion on the general idea.
Also including @mdellweg since I shared some ideas with him alreday.