From f7db1ec3cfd9e130b67b97e6a4d5e24cfc92e4eb Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Mon, 9 Sep 2024 09:39:13 -0700 Subject: [PATCH] CI: use private IPs for multinode tests If the nodepool provider uses NAT'd floating IPs, the public IP won't actually be available locally for binding. This has caused a bunch of failures on raxflex lately. Change-Id: I5669a814377242e9939a09a42bb36642358b85b3 --- .../playbooks/multinode_setup/make_rings.yaml | 10 ++--- .../templates/make_multinode_rings.j2 | 40 +++++++++---------- .../multinode_setup/templates/test.conf.j2 | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/playbooks/multinode_setup/make_rings.yaml b/tools/playbooks/multinode_setup/make_rings.yaml index b2ef444ff1..aea55e5e7b 100644 --- a/tools/playbooks/multinode_setup/make_rings.yaml +++ b/tools/playbooks/multinode_setup/make_rings.yaml @@ -57,7 +57,7 @@ - name: set the options in the proxy config file shell: cmd: | - crudini --set /etc/swift/proxy-server.conf DEFAULT bind_ip {{ hostvars['proxy1'].nodepool.public_ipv4 }} + crudini --set /etc/swift/proxy-server.conf DEFAULT bind_ip {{ hostvars['proxy1'].nodepool.private_ipv4 }} crudini --set /etc/swift/proxy-server.conf DEFAULT user {{ ansible_user_id }} crudini --set /etc/swift/proxy-server.conf app:proxy-server node_timeout 20 executable: /bin/bash @@ -71,7 +71,7 @@ - name: set the options in the account config file shell: cmd: | - crudini --set /etc/swift/account-server.conf DEFAULT bind_ip {{ hostvars['account1'].nodepool.public_ipv4 }} + crudini --set /etc/swift/account-server.conf DEFAULT bind_ip {{ hostvars['account1'].nodepool.private_ipv4 }} crudini --set /etc/swift/account-server.conf DEFAULT user {{ ansible_user_id }} executable: /bin/bash @@ -84,7 +84,7 @@ - name: set the options in the container config file shell: cmd: | - crudini --set /etc/swift/container-server.conf DEFAULT bind_ip {{ hostvars['container1'].nodepool.public_ipv4 }} + crudini --set /etc/swift/container-server.conf DEFAULT bind_ip {{ hostvars['container1'].nodepool.private_ipv4 }} crudini --set /etc/swift/container-server.conf DEFAULT user {{ ansible_user_id }} executable: /bin/bash @@ -97,7 +97,7 @@ - name: set the options in the object config file shell: cmd: | - crudini --set /etc/swift/object-server.conf DEFAULT bind_ip {{ hostvars['object1'].nodepool.public_ipv4 }} + crudini --set /etc/swift/object-server.conf DEFAULT bind_ip {{ hostvars['object1'].nodepool.private_ipv4 }} crudini --set /etc/swift/object-server.conf DEFAULT user {{ ansible_user_id }} crudini --set /etc/swift/object-server.conf DEFAULT conn_timeout 3 crudini --set /etc/swift/object-server.conf DEFAULT container_update_timeout 3 @@ -139,7 +139,7 @@ executable: /bin/bash - name: scp rings to all swift-cluster nodes - command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_user }}/rings/{{ item[0] }} {{ ansible_user }}@{{ hostvars[item[1]].nodepool.public_ipv4 }}:/etc/swift + command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_user }}/rings/{{ item[0] }} {{ ansible_user }}@{{ hostvars[item[1]].nodepool.private_ipv4 }}:/etc/swift with_nested: - ['account.ring.gz', 'container.ring.gz', 'object.ring.gz', 'object-1.ring.gz', 'object-2.ring.gz'] - "{{ groups['swift-cluster'] }}" diff --git a/tools/playbooks/multinode_setup/templates/make_multinode_rings.j2 b/tools/playbooks/multinode_setup/templates/make_multinode_rings.j2 index fdb9b27352..500448f3d9 100755 --- a/tools/playbooks/multinode_setup/templates/make_multinode_rings.j2 +++ b/tools/playbooks/multinode_setup/templates/make_multinode_rings.j2 @@ -7,32 +7,32 @@ cd /home/{{ ansible_user }}/rings rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz swift-ring-builder object.builder create 10 3 1 -swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 -swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 -swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 +swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 +swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 +swift-ring-builder object.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 swift-ring-builder object.builder rebalance swift-ring-builder object-1.builder create 10 2 1 -swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 -swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 -swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 +swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 +swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 +swift-ring-builder object-1.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 swift-ring-builder object-1.builder rebalance swift-ring-builder object-2.builder create 10 6 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb4 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb5 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb6 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb7 1 -swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.public_ipv4 }}:{{ swift_base_port + 10 }}/sdb8 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb1 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb2 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb3 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb4 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb5 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb6 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb7 1 +swift-ring-builder object-2.builder add r1z1-{{ hostvars['object1'].nodepool.private_ipv4 }}:{{ swift_base_port + 10 }}/sdb8 1 swift-ring-builder object-2.builder rebalance swift-ring-builder container.builder create 10 3 1 -swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.public_ipv4 }}:{{ swift_base_port + 11 }}/sdb1 1 -swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.public_ipv4 }}:{{ swift_base_port + 11 }}/sdb2 1 -swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.public_ipv4 }}:{{ swift_base_port + 11 }}/sdb3 1 +swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.private_ipv4 }}:{{ swift_base_port + 11 }}/sdb1 1 +swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.private_ipv4 }}:{{ swift_base_port + 11 }}/sdb2 1 +swift-ring-builder container.builder add r1z1-{{ hostvars['container1'].nodepool.private_ipv4 }}:{{ swift_base_port + 11 }}/sdb3 1 swift-ring-builder container.builder rebalance swift-ring-builder account.builder create 10 3 1 -swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.public_ipv4 }}:{{ swift_base_port + 12 }}/sdb1 1 -swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.public_ipv4 }}:{{ swift_base_port + 12 }}/sdb2 1 -swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.public_ipv4 }}:{{ swift_base_port + 12 }}/sdb3 1 +swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.private_ipv4 }}:{{ swift_base_port + 12 }}/sdb1 1 +swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.private_ipv4 }}:{{ swift_base_port + 12 }}/sdb2 1 +swift-ring-builder account.builder add r1z1-{{ hostvars['account1'].nodepool.private_ipv4 }}:{{ swift_base_port + 12 }}/sdb3 1 swift-ring-builder account.builder rebalance diff --git a/tools/playbooks/multinode_setup/templates/test.conf.j2 b/tools/playbooks/multinode_setup/templates/test.conf.j2 index 9be3a23f17..59328ee3bf 100644 --- a/tools/playbooks/multinode_setup/templates/test.conf.j2 +++ b/tools/playbooks/multinode_setup/templates/test.conf.j2 @@ -1,6 +1,6 @@ [func_test] # Sample config for Swift with tempauth -auth_host = {{ hostvars['proxy1'].nodepool.public_ipv4 }} +auth_host = {{ hostvars['proxy1'].nodepool.private_ipv4 }} auth_port = 8080 auth_ssl = no auth_prefix = /auth/