34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
---
|
|
- name: UUID Target
|
|
hosts: bigboot
|
|
become: false
|
|
gather_facts: true
|
|
|
|
vars:
|
|
uuid_target: /dev/mapper/system-swap
|
|
|
|
tasks:
|
|
- name: Debug uuid_target
|
|
ansible.builtin.debug:
|
|
var: uuid_target
|
|
|
|
- name: Capture UUID for target volume
|
|
ansible.builtin.set_fact:
|
|
bigboot_lv_uuid: "{{ ansible_facts['mounts'] | selectattr('device', 'equalto', uuid_target) | map(attribute='uuid') | first }}"
|
|
|
|
- name: Display something
|
|
ansible.builtin.debug:
|
|
msg: "{{ ansible_devices['dm-1']['links']['uuids'][0] }} <-> {{ bigboot_lv_uuid }}"
|
|
|
|
- name: Capture block device information for target logical volume
|
|
ansible.builtin.set_fact:
|
|
bigboot_lv_dm: "{{ ansible_device_links['uuids'] | dict2items | selectattr('value', 'contains', bigboot_lv_uuid) | map(attribute='key') | first }}"
|
|
|
|
- name: Debug bigboot_lv_dm
|
|
ansible.builtin.debug:
|
|
var: bigboot_lv_dm
|
|
|
|
- name: "Check out sizing for {{ uuid_target + ' (' + bigboot_lv_dm + ')' }}"
|
|
ansible.builtin.debug:
|
|
msg: "{{ ansible_devices[bigboot_lv_dm]['sectors'] | int * ansible_devices[bigboot_lv_dm]['sectorsize'] | int }}"
|