Rudymil1
Rudymil1

Reputation: 67

Unable to resize logical_volume with Ansible

I use Ansible in order to resize an existing logical volume as follows: :

- name: Redimensionnement du volume logique
  lvol:
    lv: "{{ LV }}"
    vg: "{{ VG }}"
    size: "{{ size }}"
    force: yes
    resizefs: yes

However, I get the following error :

fatal: [server]: FAILED! => {"changed": false, "err": "fsadm: Cannot get FSTYPE of \"/dev/mapper/{{ VG }}-{{ LV }}".\n  Filesystem check failed.\n", "msg": "Unable to resize {{ LV }} to {{ size }}", "rc": 5}

Why cannot I get FSTYPE ?

How may I get it ?

Upvotes: 2

Views: 1955

Answers (2)

Rudymil1
Rudymil1

Reputation: 67

Finally I found the solution :

I removed the resizefs parameter. Indeed, its default value is no, that's means the underlying filesystem is not resized together with the logical volume.

In my case the resize of the logical volume is sufficient :

- name: Redimensionnement du volume logique
  lvol:
    lv: "{{ LV }}"
    vg: "{{ VG }}"
    size: "{{ size }}"
    force: yes

Upvotes: 2

Rudymil1
Rudymil1

Reputation: 67

The vars definition :

LV: "lv_folder"
VG: "data_vg"

The command I used :

ansible-playbook -i hosts.ini playbook.yml -e size=20G -v

Upvotes: 0

Related Questions