I use Ansible 1.7.1
Can you express your agumentation in application to the specific problem
with docker module and evn. vars?
Regarding idempotence concept - seems like you right.
By the way I think I've found a workaround - instead of env. vars there
is possible to use a config file, so it will be easier to check for
changes, and whats regarding to issue 1) - I think it is possible to use
container names for that and check specific names everytime - not random
auto-generated by docker.
On 09/16/2014 04:29 PM, Michael DeHaan wrote:
That parameter is probably intended to be set only at launch time, and
is not so much an idempotence problem so much as it's probably not
changing anything.
Worth checking. Idempotence is a frequently misunderstood concept,
which is why we try to not use the word very much.
It only means that repeated runs on the same thing to not introduce
new effects F(x) = F(F(x)), it's not so much about return codes.
Also, for completeness, please share the version of Ansible that you
are using?
Thanks!
On Tue, Sep 16, 2014 at 6:29 AM, Andrew Pashkin
<[email protected] <mailto:[email protected]>> wrote:
Hi all!
I've found, that if run such command:
- docker: image=registry state=running
And then:
- docker: image=registry state=runningenv="SOMEVAR=1"
The module will return "ok", not "changed" and docker container
will not be relaunched with new parameters.
At first sight it may seem like this problem can be easily
resolved by introducing some check in the module.
But if we think better we will find at least two problems:
1) What the module should do with a container that was
launched with old parameters?
2) docker run registry -e "SOMEVAR=1" is a different call from
just docker run registry, but the only way to inspect what
environment variables in a container (AFAIK) is docker inspect
-f "{{ .Config.Env }}" our_container and there will be some
default environment variables as HOME. And also we need to
ensure that there is no stale user-defined environment
variables. So I don't see any straight-forward ways to check
if a container was launched with exact environment variables
as defined in current version of playbook.
I want to discuss, what is the best way to make this module
operate fully in idempotent fashion.
--
With kind regards, Andrew Pashkin.
cell phone -+7 (985) 898 57 59 <tel:%2B7%20%28985%29%20898%2057%2059>
Skype - waves_in_fluids
e-mail [email protected] <mailto:[email protected]>
--
You received this message because you are subscribed to the Google
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to
[email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/541810FD.6030907%40gmx.co.uk
<https://groups.google.com/d/msgid/ansible-project/541810FD.6030907%40gmx.co.uk?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz%3DbLkv2S_u_5GzktvqCgxLb-iu11QZHCaFjJYhfgbqzw%40mail.gmail.com
<https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz%3DbLkv2S_u_5GzktvqCgxLb-iu11QZHCaFjJYhfgbqzw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - [email protected]
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/54185FD7.2060204%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.