Open yann-soubeyrand opened 8 months ago
I confirm that removing this check makes check mode work.
Hmm, this is a really good question. I'm currently tending to agree with you, that the module should simply ignore check mode. (As a workaround, you can add check_mode: false
to the task BTW, then check mode is always disabled for that task.) I'm trying to come up with scenarios where not ignoring check mode is a bad idea, but so far I found none. The module is similar to a Jinja2 filter, which also doesn't care about check mode, since it doesn't modify state actively - the user has to do something with the return value, and only that can actually modify something.
(Sorry for the late reply, I wanted to comment earlier but then I got side-tracked, and then I suddenly saw it's four days later and I still haven't replied :) )
I've been thinking about this some more. I think we have three possibilities:
check_mode: false
for the task), and eventually change the default.Basically both changing the default in 2, and doing 3, is a breaking change, since the current behavior has been there for a long time. This could potentially break users. (Which obviously is true for any change.) So IMO we should not do that without a new major release. We currently don't have concrete plans for a 3.0.0 release (#559), but I wouldn't mind doing that not too far in the future.
Not doing the change now is fine I think, since it is easy to work around this by adding check_mode: false
to the task. So we shouldn't rush anything.
I'm currently trying to figure out whether making the behavior configurable is worth the trouble. I guess the main question is whether the old behavior is something that folks need. Or whether they need something else than the current and the potentially new behavior - like generate the object in question in case it doesn't exist, but don't re-generate it if it should be re-generated, but only in check mode. I don't think anything more complex than "current behavior or check_mode: false
behavior" is really necessary.
@MarkusTeufelberger @Ajpantuso what do you think?
@felixfontein I also don't see real benefit from making this configurable. I think option 3 in the 3.0.0
release sounds right given there is a workaround and changing the behavior will result in the "least surprise".
@Ajpantuso :+1: I think it makes sense to add a change now that emits a deprecation warning in cases where the behavior will change, so that users know that something will happen.
I created a PR for the deprecation: #714.
Thanks @felixfontein!
I'm going to merge #714 this weekend (and do a new release) if nobody objects.
Hi,
When referencing an
openssl_csr_pipe
in anopenssl_tls_certificate
(see below), the check mode fails because thecsr_content
is empty. Looking at the code, shouldn’t this check be removed in order to always generate the CSR (since it’s a pipe resource)?