Let's say I have the following example storing all git config values ββin Ansible variable:
- shell: git config --global --list register: git_config_list
Ansible stores the result of this command in the variable git_config_list , and one of the elements is stdout_lines , containing the output of the command in an array of records, for example
[ "user.name=Foo Bar", "user.email=foo@example.com" ]
How to check if a specific value is set, for example. to verify that user.name matters?
Is there a way to call something like contains in an array in combination with a regular expression that allows me to find the value I'm looking for? Or do I need to stdout_lines over stdout_lines entries to find what I'm looking for?
It's nice to appreciate an example of how to do something like this.
ansible
nwinkler
source share