{"id":15,"sha1":"46b46c014049492057704bfb7572ebe23cfe2a7d","playbook":{"id":1,"items":{"plays":1,"tasks":154,"results":154,"hosts":1,"files":22,"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-14T10:02:53.495102Z","ended":"2025-12-14T10:04:31.439747Z","duration":"00:01:37.944645","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.13.5","server_version":"1.7.4","status":"completed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/tests/bootstrap-aio.yml","controller":"np02505b6944e64","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\n# Only execute the disk partitioning process if a partition labeled\n#  'openstack-data{1,2}' is not present and that partition is not\n#  formatted as ext4. This is an attempt to achieve idempotency just\n#  in case these tasks are executed multiple times.\n- name: Determine whether partitions labeled openstack-data{1,2} are present\n  ansible.builtin.shell: |\n    set -o pipefail;\n    parted --script -l -m | grep -Eq ':{{ bootstrap_host_data_disk_fs_type }}:openstack-data[12]:;$'\n  args:\n    executable: /bin/bash\n  register: data_disk_partitions\n  changed_when: false\n  failed_when: false\n  tags:\n    - check-data-disk-partitions\n\n- name: Set bootstrap host data disk fact\n  ansible.builtin.set_fact:\n    bootstrap_host_data_disk_device_force: true\n    _bootstrap_host_data_disk_device: \"{{ (bootstrap_host_data_disk_device | regex_replace('!', '/')).strip() }}\"\n  when:\n    - data_disk_partitions.rc == 1\n\n- name: Dismount and remove fstab entries for anything on the data disk device\n  ansible.posix.mount:\n    name: \"{{ item.mount }}\"\n    src: \"{{ item.device }}\"\n    fstype: \"{{ bootstrap_host_data_disk_fs_type }}\"\n    state: absent\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n    - item.device is search(bootstrap_host_data_disk_device)\n  with_items:\n    - \"{{ ansible_facts['mounts'] }}\"\n\n- name: Partition the whole data disk for our usage # noqa: no-changed-when\n  ansible.builtin.command: \"{{ item }}\"\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n  with_items:\n    - \"parted --script /dev/{{ _bootstrap_host_data_disk_device }} mklabel gpt\"\n    - \"parted --align optimal --script /dev/{{ _bootstrap_host_data_disk_device }} mkpart openstack-data1 {{ bootstrap_host_data_disk_fs_type }} 0% 40%\"\n    - \"parted --align optimal --script /dev/{{ _bootstrap_host_data_disk_device }} mkpart openstack-data2 {{ bootstrap_host_data_disk2_fs }} 40% 100%\"\n  tags:\n    - create-data-disk-partitions\n\n- name: Determine partition names\n  ansible.builtin.command: \"lsblk /dev/{{ _bootstrap_host_data_disk_device }} -o NAME --noheadings --list\"\n  register: data_disk_partitions\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n  changed_when: false\n  tags:\n    - create-data-disk-partitions\n\n- name: Set bootstrap host data disk partitions fact\n  ansible.builtin.set_fact:\n    _bootstrap_host_data_partition_devices: \"{{ data_disk_partitions.stdout_lines[1:] | list }}\"\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n\n- name: Format the partition 1\n  community.general.filesystem:\n    fstype: \"{{ bootstrap_host_data_disk_fs_type }}\"\n    dev: \"/dev/{{ _bootstrap_host_data_partition_devices[0] }}\"\n    opts: \"{{ bootstrap_host_format_options[bootstrap_host_data_disk_fs_type] | default(omit) }}\"\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n  tags:\n    - format-data-partitions\n\n- name: Format the partition 2\n  community.general.filesystem:\n    fstype: \"{{ bootstrap_host_data_disk2_fs }}\"\n    dev: \"/dev/{{ _bootstrap_host_data_partition_devices[1] }}\"\n    opts: \"{{ bootstrap_host_format_options[bootstrap_host_data_disk2_fs] | default(omit) }}\"\n  when:\n    - bootstrap_host_data_disk_device_force | bool\n    - _lxc_container_backing_store != 'lvm'\n    - _lxc_container_backing_store != 'zfs'\n  tags:\n    - format-data-partitions\n\n- name: Run the systemd mount role\n  ansible.builtin.include_role:\n    name: systemd_mount\n  vars:\n    systemd_mounts:\n      - what: \"/dev/{{ _bootstrap_host_data_partition_devices[0] }}\"\n        where: \"/openstack\"\n        type: \"{{ bootstrap_host_data_disk_fs_type }}\"\n        options: \"{{ bootstrap_host_data_mount_options[bootstrap_host_data_disk_fs_type] }}\"\n        state: 'started'\n        enabled: true\n      - what: \"/dev/{{ _bootstrap_host_data_partition_devices[1] }}\"\n        where: \"{{ bootstrap_host_data_disk2_path }}\"\n        type: \"{{ bootstrap_host_data_disk2_fs }}\"\n        options: \"{{ bootstrap_host_data_disk2_fs_mount_options }}\"\n        state: \"{{ (_lxc_container_backing_store != 'lvm' and _lxc_container_backing_store != 'zfs') | ternary('started', 'stopped') }}\"\n        enabled: \"{{ (_lxc_container_backing_store != 'lvm' and _lxc_container_backing_store != 'zfs') | bool }}\"\n  tags:\n    - data-config\n\n- name: Prepare disk drive as ZFS\n  when: _lxc_container_backing_store == 'zfs'\n  block:\n    - name: Install zfs packages\n      ansible.builtin.package:\n        name: \"{{ packages_install_zfs }}\"\n        state: present\n        update_cache: \"{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}\"\n      tags:\n        - install-packages\n\n    - name: Create the ZFS pool\n      ansible.builtin.command: zpool create osa-test-pool \"/dev/{{ _bootstrap_host_data_partition_devices[1] }}\"\n      args:\n        creates: /osa-test-pool\n      when:\n        - bootstrap_host_data_disk_device_force | bool\n\n    - name: Create the ZFS osa-test-pool/lxc volume\n      ansible.builtin.shell: \"(zfs list | grep lxc) || zfs create -o mountpoint=/var/lib/lxc osa-test-pool/lxc\"\n      when:\n        - bootstrap_host_data_disk_device_force | bool\n      tags:\n        - skip_ansible_lint\n\n- name: Prepare disk drive as LVM\n  community.general.lvg:\n    vg: lxc\n    pvs: \"/dev/{{ _bootstrap_host_data_partition_devices[1] }}\"\n  tags:\n    - data-config\n  when: _lxc_container_backing_store == 'lvm'\n","created":"2025-12-14T10:03:54.000757Z","updated":"2025-12-14T10:03:54.000768Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml"}