0

i'm trying to mount disks when a ansible device correspond a specific ids name: google-pgdata

"sdc": {
            "holders": [],
            "host": "",
            "links": {
                "ids": [
                    "google-pgdata",
                    "scsi-0Google_PersistentDisk_pgdata"
                ],
                "labels": [],
                "masters": [],
                "uuids": []
            },
            "model": "PersistentDisk",
            "partitions": {},
            "removable": "0",
            "rotational": "1",
            "sas_address": null,
            "sas_device_handle": null,
            "scheduler_mode": "noop",
            "sectors": "209715200",

1 Answers1

0

You can retrieve your disk data by referencing the id's of your ansible facts by:

{{ ansible_facts['devices']['sdc']['ids'] }}

You can find more information in the Ansible playbook.

Also, to mount disks you can follow the reference of the mount module in ansible documentation.

Pooja S
  • 145
  • 4
Nahuel
  • 3
  • 2