Rolling updates with loadbalancers and backends on different ports...

Hi all,

I have a problem with the rolling update functionality. I have some loadbalancers and some backend servers, and need to disable the backend servers, one by one, in the loadbalancers during the upgrade. My initial connection to the lb’s to gather facts is working fine, but when I connect to the backend servers, do the preparation, and get to where I want to disable the backend server, the delegate_to is failing. I’m using the example of a rolling update from the ansible-examples git repo - with the exception that the loadbalancers and backends has SSH running on different ports.

Here’s some examples:

Inventory file:

[local]
localhost

[prod]
web01 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_port=2222 ansible_ssh_private_key_file=sshkey
web02 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_port=2223 ansible_ssh_private_key_file=sshkey

[balancers]
lb01 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_private_key_file=sshkey ansible_python_interpreter=/usr/local/bin/python2.7
lb02 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_private_key_file=sshkey ansible_python_interpreter=/usr/local/bin/python2.7

playbook:

  • hosts: balancers
    user: root
    tags: deploy
    tasks:

  • hosts: prod
    serial: 1
    tasks:

  • name: Upload DB dump to prod
    copy: src=files/db.sql dest=/tmp/db.sql
    tags: deploy

  • name: disable the backend in relayd
    shell: /usr/sbin/relayctl host disable {{ ansible_default_ipv4.address }}
    delegate_to: “{{ item }}”
    with_items: groups.balancers
    tags: deploy

Thanks in advance.

/Juri