cancel
Showing results for 
Search instead for 
Did you mean: 
Sitikantha
Mission Specialist
Mission Specialist
  • 5,239 Views

I am not getting the output for ansible_lvm fact variable

can anyone help me ???

sitikantha_mishra
Labels (1)
0 Kudos
1 Solution

Accepted Solutions
ricardodacosta
Moderator
Moderator
  • 5,236 Views

What command are you using? Are there any LVs on the managed host? If not, the command fails.

I ran the following command from my Mac where I am using ansible 2.8.3 using my tower instance as a managed host.

[rgdacosta@Ricardos-MacBook-Pro scratch ]$ ansible tower -m setup -a filter=ansible_lvm
tower | SUCCESS => {
    "ansible_facts": {
        "ansible_lvm": {
            "lvs": {
                "lv_home": {
                    "size_g": "11.54",
                    "vg": "VolGroup"
                },
                "lv_root": {
                    "size_g": "50.00",
                    "vg": "VolGroup"
                },
                "lv_swap": {
                    "size_g": "1.97",
                    "vg": "VolGroup"
                }
            },
            "pvs": {
                "/dev/sda2": {
                    "free_g": "0",
                    "size_g": "63.51",
                    "vg": "VolGroup"
                }
            },
            "vgs": {
                "VolGroup": {
                    "free_g": "0",
                    "num_lvs": "3",
                    "num_pvs": "1",
                    "size_g": "63.51"
                }
            }
        },
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "changed": false
}

----------------------------------------------------------------------------------


If you're satisfied with the solutions provided please mark the solution as ACCEPTED.

Don't forget to thank those who helped you out with kudos!

View solution in original post

0 Kudos
2 Replies
ricardodacosta
Moderator
Moderator
  • 5,237 Views

What command are you using? Are there any LVs on the managed host? If not, the command fails.

I ran the following command from my Mac where I am using ansible 2.8.3 using my tower instance as a managed host.

[rgdacosta@Ricardos-MacBook-Pro scratch ]$ ansible tower -m setup -a filter=ansible_lvm
tower | SUCCESS => {
    "ansible_facts": {
        "ansible_lvm": {
            "lvs": {
                "lv_home": {
                    "size_g": "11.54",
                    "vg": "VolGroup"
                },
                "lv_root": {
                    "size_g": "50.00",
                    "vg": "VolGroup"
                },
                "lv_swap": {
                    "size_g": "1.97",
                    "vg": "VolGroup"
                }
            },
            "pvs": {
                "/dev/sda2": {
                    "free_g": "0",
                    "size_g": "63.51",
                    "vg": "VolGroup"
                }
            },
            "vgs": {
                "VolGroup": {
                    "free_g": "0",
                    "num_lvs": "3",
                    "num_pvs": "1",
                    "size_g": "63.51"
                }
            }
        },
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "changed": false
}

----------------------------------------------------------------------------------


If you're satisfied with the solutions provided please mark the solution as ACCEPTED.

Don't forget to thank those who helped you out with kudos!

0 Kudos
  • 4,246 Views

become root than you will get lvm facts ;)

ansible]$ ansible servera -m setup -u root -b | grep lvs
"lvs": {
"num_lvs": "2",
"num_lvs": "2",

0 Kudos
Join the discussion
You must log in to join this conversation.