quick_test/something copy.yml

54 lines
1.6 KiB
YAML

---
- name: Something
hosts: bigboot
gather_facts: true
tasks:
# - name: Debug shrink_lv_devices
# ansible.builtin.debug:
# var: shrink_lv_devices
# - name: Assert shrink_lv_devices
# ansible.builtin.assert:
# that:
# - shrink_lv_devices is defined
# - shrink_lv_devices | type_debug == "list"
# - shrink_lv_devices | length > 0
# fail_msg: shrink_lv_devices must be a list and include at least one element
- name: Get /boot mount information
ansible.builtin.set_fact:
bigboot_boot_mount: "{{ ansible_facts.mounts \
| selectattr('mount', 'equalto', '/boot') | first }}"
- name: Capture device for /boot
ansible.builtin.set_fact:
bigboot_boot_device: "{{ bigboot_boot_mount.device | regex_replace('^.*/(\\w+$)', '\\1') }}"
- name: Debug bigboot_boot_mount
ansible.builtin.debug:
var: bigboot_boot_mount['device'][:-1]
- name: Capture drive for /boot
ansible.builtin.set_fact:
bigboot_boot_drive: "{{ bigboot_boot_mount['device'][:-1] }}"
- name: Debug bigboot_boot_device
ansible.builtin.debug:
var: bigboot_boot_device
- name: Debug bigboot_boot_drive
ansible.builtin.debug:
var: bigboot_boot_drive
- name: Check all devices
ansible.builtin.include_tasks: check_device.yml
# - name: Debug shrink_lv_mount_info
# ansible.builtin.debug:
# var: shrink_lv_mount_info
# - name: Debug ansible_date_time.date
# ansible.builtin.debug:
# var: ansible_date_time.date