--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6a6f36c6-6398-4fb9-83f9-59e8368cb58f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It seems that you are saying that you want to...
1) generate a single cert on the ca server
2) copy that to the ansible server
3) copy that cert to all of the other servers
If that is correct wouldn't it be best to have one pair of tasks to do 1 and 2 only on the CA server and 3 on the other servers.
Note that the cert will be different every time this is run so it will never not change. Splitting into two separate sets would allow the cert creation to be run independently from copying it out, and keep the cert push to only changing when the cert changes. An alternative would be to use creates to ensure the cert isn't recreated every time.
If the goal is to have a different cert for every host you should be able to just delegate the cert creation task and the fetch task to the ca server.
My understanding is that delegate effectively changes the target, so fetch with delegate should involve the ansible host pulling the certificate from the ca server. If this is not the case then it seems to be a bug.
We have three hosts in the equation. The machine we are running ansible on (ansibleServer) the machine we are performing tasks on (inventoryServer) and a delegate machine (delegateServer)
- task: blah blah blah
would cause ansibleServer to run a task on the inventoryServer
- task: blah blah blah
delegate_to: delegateServer
should cause ansibleServer to run the task on the delegateServer on behalf of the inventoryServer.
So
- fetch: ...
delegate_to: delegateServer
SHOULD fetch a file from delegateServer to ansibleServer rather than from inventoryServer.
If not then there is a bug in my opinion.
My under standing of delegate_to means “run the command you would have run locally on this particular host”, yes?