{"id":348,"sha1":"e859abd480042ed0b5b7d9e806f72c045d681a2f","playbook":{"id":3,"items":{"plays":37,"tasks":374,"results":364,"hosts":2,"files":208,"records":0},"arguments":{"version":null,"verbosity":0,"private_key_file":null,"remote_user":null,"connection":"openstack.osa.ssh","timeout":null,"ssh_common_args":null,"sftp_extra_args":null,"scp_extra_args":null,"ssh_extra_args":null,"ask_pass":false,"connection_password_file":null,"force_handlers":true,"flush_cache":false,"become":false,"become_method":"sudo","become_user":null,"become_ask_pass":false,"become_password_file":null,"tags":["all"],"skip_tags":[],"check":false,"diff":false,"inventory":["/home/zuul/src/opendev.org/openstack/openstack-ansible/inventory/dynamic_inventory.py","/home/zuul/src/opendev.org/openstack/openstack-ansible/inventory/inventory.ini","/etc/openstack_deploy/inventory.ini"],"listhosts":false,"subset":null,"extra_vars":"Not saved by ARA as configured by 'ignored_arguments'","vault_ids":[],"ask_vault_pass":false,"vault_password_files":[],"forks":8,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["setup-infrastructure.yml"]},"labels":[{"id":1,"name":"check:False"},{"id":2,"name":"tags:all"}],"started":"2025-12-08T13:33:24.432723Z","ended":"2025-12-08T13:39:38.483304Z","duration":"00:06:14.050581","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.12.3","server_version":"1.7.4","status":"completed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/playbooks/setup-infrastructure.yml","controller":"aio1.openstack.local","user":"root"},"content":"---\n# Copyright 2014, Rackspace US, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n###########################################################################\n# Service frontends and backends assembled from fragments into haproxy.conf\n###########################################################################\n\n- name: Create haproxy service config files\n  ansible.builtin.template:\n    src: service.j2\n    dest: \"/etc/haproxy/conf.d/{{ service.haproxy_service_name }}\"\n    owner: root\n    group: haproxy\n    mode: \"0640\"\n  loop: \"{{ haproxy_service_configs }}\"\n  loop_control:\n    loop_var: service\n  when:\n    - (service.haproxy_backend_nodes is defined and\n      service.haproxy_backend_nodes | length > 0) or\n      (service.haproxy_backup_nodes is defined and\n      service.haproxy_backup_nodes | length > 0) or\n      service.haproxy_frontend_only | default('False')\n    - (service.haproxy_service_enabled | default('True')) | bool\n    - (service.state is not defined or service.state != 'absent')\n  notify: Regenerate haproxy configuration\n\n- name: Remove haproxy service config files for absent services\n  ansible.builtin.file:\n    path: \"/etc/haproxy/conf.d/{{ service.haproxy_service_name }}\"\n    state: absent\n  notify: Regenerate haproxy configuration\n  loop: \"{{ haproxy_service_configs }}\"\n  loop_control:\n    loop_var: service\n  when:\n    - ((service.haproxy_service_enabled | default('True')) | bool) is falsy or (service.state is defined and service.state == 'absent')\n\n###########################################################################\n# Map files assembled from fragments from each service into <map-name>.map\n###########################################################################\n\n- name: Create haproxy map fragment directories\n  ansible.builtin.file:\n    state: directory\n    path: \"/etc/haproxy/map.conf.d/{{ item }}\"\n    owner: root\n    group: haproxy\n    mode: \"0750\"\n  loop: >-\n    {{\n      haproxy_service_configs | selectattr('haproxy_map_entries', 'defined') | map(attribute='haproxy_map_entries') | flatten |\n      map(attribute='name') | unique\n    }}\n\n# create map entries when the service is enabled and an existing map fragment is not absent\n- name: Create haproxy map files\n  vars:\n    map_file: \"/etc/haproxy/map.conf.d/{{ item.1.name }}/{{ item.1.order | default('00') }}-{{ item.0.haproxy_service_name }}.map\"\n  ansible.builtin.template:\n    src: map.j2\n    dest: \"{{ map_file }}\"\n    owner: root\n    group: haproxy\n    mode: \"0640\"\n  with_subelements:\n    - \"{{ haproxy_service_configs | selectattr('haproxy_map_entries', 'defined') }}\"\n    - haproxy_map_entries\n  when:\n    - (item.0.haproxy_service_enabled | default(True)) | bool\n    - item.1.state | default('present') != 'absent'\n  notify: Regenerate maps\n  register: map_create\n\n# remove map entries when the service is not enabled, the service is absent or the map is absent\n- name: Delete unused map entries\n  ansible.builtin.file:\n    state: absent\n    path: \"/etc/haproxy/map.conf.d/{{ item.1.name }}/{{ item.1.order | default('00') }}-{{ item.0.haproxy_service_name }}.map\"\n  when:\n    - (item.0.haproxy_service_enabled | default('True')) | bool is falsy or\n      (item.0.state is defined and item.0.state == 'absent') or\n      (item.1.state | default('present') == 'absent')\n  with_subelements:\n    - \"{{ haproxy_service_configs | selectattr('haproxy_map_entries', 'defined') }}\"\n    - haproxy_map_entries\n  notify: Regenerate maps\n  register: map_delete\n","created":"2025-12-08T13:34:47.684237Z","updated":"2025-12-08T13:34:47.684269Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible-haproxy_server/tasks/haproxy_service_config.yml"}