Hi,
I have had a playbook in production that uses a pre_tasks section that
removes a server from load balancers before deploying updated code. It was
working fine under ansible 1.9.4 however after upgrading to ansible 2.0.1.0
the pretasks are carried out twice on one of the loadbalancers. I have
setup an example playbook on a few vagrant machines to troubleshoot and
still experience the same issue
My Inventory file:
[local]
127.0.0.1
[proxies]
192.168.56.101 ansible_ssh_user=vagrant
192.168.56.102 ansible_ssh_user=vagrant
any my playbook:
- name: poll proxies
hosts: proxies
tasks: []
- name: test deployment script
hosts: localhost
pre_tasks:
- name: debug groups
debug:
msg: "{% for name in groups['proxies'] %} {{ name }} {% endfor %}"
- name: take out admin backend from upstream
shell: rpl "server {{ inventory_hostname }}" "#server {{
inventory_hostname }}" /etc/rpl
delegate_to: "{{ item }}"
with_items: "{{ groups['proxies'] }}"
become: true
- name: pause
pause:
seconds: 15
- name: add out admin backend from upstream
shell: rpl "#server {{ inventory_hostname }}" "server {{
inventory_hostname }}" /etc/rpl
delegate_to: "{{ item }}"
with_items: "{{ groups['proxies'] }}"
become: true
--
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/44c1b6a3-818b-4c09-bdfd-436758854f87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.