ansible --version
ansible 2.2.1.0
config file = /etc/ansible/ansible.cfg
Am using find modules to get largest files and its size the file, I am getting a big jason format output, How can i parse one particular string from the output.
ansible --version
ansible 2.2.1.0
config file = /etc/ansible/ansible.cfg
Am using find modules to get largest files and its size the file, I am getting a big jason format output, How can i parse one particular string from the output.
How, depends on what you are going to do with path and size, so this is one of several ways.
- debug: msg="{{ item.path }} - {{ item.size }}"
with_items: "{{ logfile.files }}"
yes… with this it prints the path and size along with the whole output. but i need only the parsed output.
You don't say what you are going to use this for.
If you would like it in a file, use the template module.
If you would like to have it displayed nice on the screen you are probably using the wrong tool.
Ansible is not a reporting tool but a configuration management tool.
But you could write your one callback plugin to make the output the way you want it to be.
The idea is to delete the file…
I need the formatted output, because my associated application is expecting such an input from ansible…
thanks for the info…