diff --git a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 index c9c8e7f4c6..ef2e521564 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 +++ b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 @@ -140,6 +140,7 @@ shared-infra_hosts: galera_container: 3 memcached_container: 3 rabbit_mq_container: 3 + repo_container: 3 {% endif %} repo-infra_hosts: diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index d9e2b4a97a..1e735f1cf1 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -68,7 +68,9 @@ haproxy_default_services: haproxy_port: 8181 haproxy_balance_type: http haproxy_backend_options: - - "httpchk HEAD / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" + - "httpchk GET /repo_sync_complete HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" + haproxy_backend_httpcheck_options: + - "expect status 200" haproxy_service_enabled: "{{ groups['repo_all'] is defined and groups['repo_all'] | length > 0 }}" - service: haproxy_service_name: glance_api diff --git a/playbooks/healthcheck-infrastructure.yml b/playbooks/healthcheck-infrastructure.yml index 82f4b3f97b..326a307b6d 100644 --- a/playbooks/healthcheck-infrastructure.yml +++ b/playbooks/healthcheck-infrastructure.yml @@ -24,9 +24,9 @@ hosts: all_containers[0]:physical_hosts[0] gather_facts: yes vars: - repo_requirements_file: "os-releases/{{ openstack_release }}/{{ os_distro_version }}/" + repo_requirements_file: "repo_sync_complete" tasks: - - name: Check the upper constraint on each repo server + - name: Check the repo sync file on each repo server uri: url: "http://{{ hostvars[item]['container_address'] }}:{{ repo_server_port }}/{{ repo_requirements_file }}" with_inventory_hostnames: "{{ groups['repo_all'] }}" diff --git a/releasenotes/notes/repo_check-31eb53ae77ddeb41.yaml b/releasenotes/notes/repo_check-31eb53ae77ddeb41.yaml new file mode 100644 index 0000000000..8df046b25a --- /dev/null +++ b/releasenotes/notes/repo_check-31eb53ae77ddeb41.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + HAProxy now verifies if repo server is healthy by ``repo_sync_complete`` + file that is created with repo_server role. This should prevent + non-synced repo containers from participating in load balancing.