I am trying to register the output of a shell command, set it as a fact,
and then run the playbook only when there is not a match. Example:
---
- name: Register git version that is installed on system
shell: git --version | sed 's/git\ version\ //g'
register: git_version_output
tags: register
- name: Set git_installed_version fact
set_fact: git_installed_version=git_version_output.stdout_lines
tags: fact
- name: Dump git_installed_version to file
debug: msg="success"
when: git_version_output == {{ git_version }}
tags: dump
But, I'm getting the following error:
error while evaluating conditional: git_version_output == 2.3.2
I'm not quite sure if the syntax is right and I'm completely lost on how to
make the playbook run/not run if the conditional is met/not met.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/941d93cb-bb5a-4f08-a441-7a05d3e0055b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.