Modifying setup will work, but take into account that this is relied on by default for all plays. I had this at one point (for freebsd), but didn't need it any more and setup has changed a lot since then.
You can also create your own module that adds custom facts.
Brian Coca
I just remembered, check the setup module docs, it uses a couple of popular system info gathering utilities if they are installed on the target, they might already get the mount info.
Brian Coca
I just remembered, check the setup module docs, it uses a couple of popular system info gathering utilities if they are installed on the target, they might already get the mount info.
Brian Coca
--
It looks like facter/ohai needs ruby installed on remote machines, I wanted something pure python and with least dependencies, So tried to create a module.newbie alert ! How to get this module (attached) reviewed /get help ?I tried to port the disk-info python script to a Ansible module (from little i understand- started reading about Ansible yesterday). I have attached the module here. I would appreciate if i can get some comments on how to improve it , so it follows all the ansible conventions.The output looks like this:{'Devices': {'sda': {'vendor': 'ATA', 'sectors': '976773168', 'sector size(bytes)': '512', 'disk type': 'Spinning disk', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'sda2': {'holders': {0: 'VolGroup00-LogVol01', 1: 'VolGroup00-LogVol00'}, 'sectors': '975747072', 'start sector': '1026048', 'size': '465.27GiB'}, 'removable': 'No', 'sda1': {'sectors': '1024000', 'start sector': '2048', 'size': '500.00MiB'}, 'support discard': 'No', 'model': 'ST500DM002-1BC14', 'size': '465.76GiB'}, 'sdb': {'vendor': 'ATA', 'sectors': '395093371', 'sector size(bytes)': '512', 'disk type': 'SSD', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'removable': 'No', 'support discard': 'Yes', 'model': 'SAMSUNG SSD 830', 'size': '188.40GiB'}, 'sdc': {'vendor': 'ATA', 'sectors': '395093371', 'sector size(bytes)': '512', 'disk type': 'SSD', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'removable': 'No', 'support discard': 'Yes', 'model': 'SAMSUNG SSD 830', 'size': '188.40GiB'}}}(to get the above result in main of get_devices module, i commented out ansible related stuff and ran as a standalone python script which just printed output of get_devices(module))Regards,--Kavin K
It looks like facter/ohai needs ruby installed on remote machines, I wanted something pure python and with least dependencies, So tried to create a module.newbie alert ! How to get this module (attached) reviewed /get help ?
I tried to port the disk-info python script to a Ansible module (from little i understand- started reading about Ansible yesterday). I have attached the module here. I would appreciate if i can get some comments on how to improve it , so it follows all the ansible conventions.The output looks like this:{'Devices': {'sda': {'vendor': 'ATA', 'sectors': '976773168', 'sector size(bytes)': '512', 'disk type': 'Spinning disk', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'sda2': {'holders': {0: 'VolGroup00-LogVol01', 1: 'VolGroup00-LogVol00'}, 'sectors': '975747072', 'start sector': '1026048', 'size': '465.27GiB'}, 'removable': 'No', 'sda1': {'sectors': '1024000', 'start sector': '2048', 'size': '500.00MiB'}, 'support discard': 'No', 'model': 'ST500DM002-1BC14', 'size': '465.76GiB'}, 'sdb': {'vendor': 'ATA', 'sectors': '395093371', 'sector size(bytes)': '512', 'disk type': 'SSD', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'removable': 'No', 'support discard': 'Yes', 'model': 'SAMSUNG SSD 830', 'size': '188.40GiB'}, 'sdc': {'vendor': 'ATA', 'sectors': '395093371', 'sector size(bytes)': '512', 'disk type': 'SSD', 'host': 'SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)', 'removable': 'No', 'support discard': 'Yes', 'model': 'SAMSUNG SSD 830', 'size': '188.40GiB'}}}(to get the above result in main of get_devices module, i commented out ansible related stuff and ran as a standalone python script which just printed output of get_devices(module))Regards,--Kavin KOn Fri, Dec 28, 2012 at 5:03 PM, Brian Coca <bria...@gmail.com> wrote:
I just remembered, check the setup module docs, it uses a couple of popular system info gathering utilities if they are installed on the target, they might already get the mount info.
Brian Coca
--
--
--
--