To collect dmidecode on a remote node in a json format
To collect dmidecode information on a remote node in json format
- Create a hosts file
- Update remote_user in main.yml if the user is not root
- run
ansible-playbook -i hosts main.yml
- use -v if you want to see the output
- add a role to either view the var like debug if needed
it's as simple as running sudo dmidecode_json.py >> dmidecode_json.json
If you want to extract only a specific type you can add --type
arg followed types needed ex:
sudo dmidecode_json.py --type 4 5 6 >> dmidecode_type_4_5_6_only.json
You can also add to the code to extract a particular field as it's in json format
Also makes it easier to push to Elasticsearch