{"id":5,"sha1":"95861897c42aac672ce2da966da3dfbe7fc3cdbc","playbook":{"id":1,"items":{"plays":1,"tasks":156,"results":156,"hosts":1,"files":23,"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/tests/test-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":10,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["bootstrap-aio.yml"]},"labels":[{"id":1,"name":"check:False"},{"id":2,"name":"tags:all"}],"started":"2025-12-05T13:21:24.276345Z","ended":"2025-12-05T13:22:19.245869Z","duration":"00:00:54.969524","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.12.11","server_version":"1.7.4","status":"completed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/tests/bootstrap-aio.yml","controller":"np6cc01eb996274","user":"root"},"content":"---\n# Copyright 2015, 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- name: Check for a supported Operating System\n  ansible.builtin.include_role:\n    name: openstack.osa.platform_check\n    apply:\n      tags:\n        - check-operating-system\n  when:\n    - (check_operating_system | default(True)) | bool\n  tags:\n    - check-operating-system\n\n- name: Check that bootstrap_host_scenario is not set with mutually exclusive options\n  ansible.builtin.assert:\n    that:\n      - not item.conditional\n    msg: \"{{ item.msg }}\"\n  with_items:\n    - conditional: \"{{ (bootstrap_host_scenario is search('distro')) and (bootstrap_host_scenario is search('source')) }}\"\n      msg: \"The scenario key words 'distro' and 'source' are mutually exclusive.\"\n    - conditional: \"{{ (bootstrap_host_scenario is search('lxc')) and (bootstrap_host_scenario is search('metal')) }}\"\n      msg: \"The scenario key words 'lxc' and 'metal' are mutually exclusive.\"\n\n- name: Identify the space available in /\n  # NOTE(hwoarang): df does not work reliably on btrfs filesystems\n  # https://btrfs.wiki.kernel.org/index.php/FAQ#How_much_free_space_do_I_have.3F\n  # As such, use the btrfs tools to determine the real available size on the\n  # disk\n  ansible.builtin.shell: |\n    set -o pipefail\n    if [[ $(df -T / | tail -n 1 | awk '{print $2}') == \"btrfs\" ]]; then\n        btrfs fi du -s --raw / 2>/dev/null | awk '/[0-9]/ {print $2*1024}'\n    else\n        df -BK / | awk '!/^Filesystem/ {print $4}' | sed 's/K//'\n    fi\n  args:\n    executable: /bin/bash\n  environment:\n    LC_ALL: en_US.UTF-8\n  when:\n    - bootstrap_host_data_disk_device == None\n  changed_when: false\n  register: root_space_available\n  tags:\n    - check-disk-size\n\n# Convert root_space_available to bytes.\n- name: Set root disk facts\n  ansible.builtin.set_fact:\n    host_root_space_available_bytes: \"{{ (root_space_available.stdout | int) * 1024 | int }}\"\n  when:\n    - bootstrap_host_data_disk_device == None\n  tags:\n    - check-disk-size\n\n- name: Fail when disk can not be found\n  ansible.builtin.fail:\n    msg: |\n      Can not find disk {{ bootstrap_host_data_disk_device }}\n  when:\n    - bootstrap_host_data_disk_device != None\n    - ansible_facts['devices'] is defined\n    - ansible_facts['devices'].get(bootstrap_host_data_disk_device) == None\n  tags:\n    - check-disk-size\n\n- name: Set data disk facts\n  ansible.builtin.set_fact:\n    host_data_disk_sectors: \"{{ (ansible_facts['devices'][bootstrap_host_data_disk_device]['sectors'] | int) }}\"\n    host_data_disk_sectorsize: \"{{ (ansible_facts['devices'][bootstrap_host_data_disk_device]['sectorsize'] | int) }}\"\n  when:\n    - bootstrap_host_data_disk_device != None\n  tags:\n    - check-disk-size\n\n# Calculate the size of the bootstrap_host_data_disk_device by muliplying sectors with sectorsize.\n- name: Calculate data disk size\n  ansible.builtin.set_fact:\n    host_data_disk_size_bytes: \"{{ ((host_data_disk_sectors | int) * (host_data_disk_sectorsize | int)) | int }}\"\n  when:\n    - bootstrap_host_data_disk_device != None\n  tags:\n    - check-disk-size\n\n# Convert bootstrap_host_data_disk_min_size to bytes.\n- name: Set min size fact\n  ansible.builtin.set_fact:\n    host_data_disk_min_size_bytes: \"{{ ((bootstrap_host_data_disk_min_size | int) * 1024**3) | int }}\"\n  tags:\n    - check-disk-size\n\n- name: Set size facts\n  ansible.builtin.set_fact:\n    root_gb_available: \"{{ ((host_root_space_available_bytes | int) / 1024**3) | round(2, 'floor') }}\"\n  when: bootstrap_host_data_disk_device == None\n  tags:\n    - check-disk-size\n\n- name: Set disk size facts\n  ansible.builtin.set_fact:\n    disk_gb_available: \"{{ ((host_data_disk_size_bytes | int) / 1024**3) | round(2, 'floor') }}\"\n  when: bootstrap_host_data_disk_device != None\n  tags:\n    - check-disk-size\n\n- name: Fail if there is not enough space available in /\n  ansible.builtin.fail:\n    msg: |\n      Not enough space available in /.\n      Found {{ root_gb_available }} GB, required {{ bootstrap_host_data_disk_min_size }} GB)\n  when:\n    - bootstrap_host_data_disk_device == None\n    - (host_root_space_available_bytes | int) < (host_data_disk_min_size_bytes | int)\n  tags:\n    - check-disk-size\n\n- name: Fail if there is not enough disk space available (disk specified)\n  ansible.builtin.fail:\n    msg: |\n      Not enough disk space available.\n      Found {{ disk_gb_available }} GB, required {{ bootstrap_host_data_disk_min_size }} GB)\n  when:\n    - bootstrap_host_data_disk_device != None\n    - (host_data_disk_size_bytes | int) < (host_data_disk_min_size_bytes | int)\n  tags:\n    - check-disk-size\n","created":"2025-12-05T13:21:24.545920Z","updated":"2025-12-05T13:21:24.545933Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/tests/roles/bootstrap-host/tasks/check-requirements.yml"}