Hello, I'm starting with Ansible and I have a question about the Playbook

36 views
Skip to first unread message

Vinicius Barreto

unread,
Oct 1, 2018, 4:12:53 PM10/1/18
to Ansible Project

Hello, I'm starting with Ansible and I have a question about the Playbook:


Assuming that I create a configuration deployment / update recipe for the [web servers] group, and put it on the new "clean" server in this group and run this Playbook, Ansible will be able to detect that the old servers have already received the current configuration and it will igorará them, and in this way will execute the current configuration only in the new servers or Ansible would execute this Playbook in all the servers of the group, memso in those that already received this current configuration?

Thanks to all who can help!

Vinicius Barreto

unread,
Oct 1, 2018, 4:14:49 PM10/1/18
to Ansible Project
ansible version: 1.7.2

Fabio Gomes Sakiyama

unread,
Oct 1, 2018, 4:38:50 PM10/1/18
to ansible...@googlegroups.com
Hi Vinícius,

Im pretty sure ansible wont work as you expect. He works in an imperative way rather than declarative, like puppet for example. You will have to manually check if the server should or not be updated, since ansible doesnt natively stores states.

Hope It clarifies you.



--
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/875c15ef-c2cb-415e-b219-8d8eacea30af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vinicius Barreto

unread,
Oct 1, 2018, 4:43:15 PM10/1/18
to ansible...@googlegroups.com
Hello Fabio, I understand. Thank you very much for your reply.


For more options, visit https://groups.google.com/d/optout.


--
Marcos Vinícius Barreto das Chagas

Fabio Gomes Sakiyama

unread,
Oct 1, 2018, 4:45:16 PM10/1/18
to ansible...@googlegroups.com
Sorry, I Think I misread your question.

If youre talking about changing ansible hosts, adding a New server inside a group, ansible Will rerun tour playbook on all hosts, but he also detect If a task should run or not. When the result is a Green "ok", It means It didnt changed anything. So It Will probably work as you expect.


Message has been deleted

Everson Leal

unread,
Oct 1, 2018, 4:58:59 PM10/1/18
to Ansible Project
Just pay attention on shell, raw or command tasks, it's just runs and command on the server and can't check if it was ran before, see the changed_when clause: https://docs.ansible.com/ansible/2.6/user_guide/playbooks_error_handling.html#overriding-the-changed-result

Vinicius Barreto

unread,
Oct 1, 2018, 5:00:18 PM10/1/18
to Ansible Project
Thank you very much Fabio!

Vinicius Barreto

unread,
Oct 1, 2018, 5:01:02 PM10/1/18
to Ansible Project
Hello Everson, thank you very much!
Reply all
Reply to author
Forward
0 new messages