I have configured several set_fact tasks. However, to me it feels that this is not DRY.
For example, I configure 2 different tasks to set a fact based on a different when clause:
- set_fact:
installed: false
when: "'abc' not in ansible_facts.packages"
- set_fact:
installed: true
when: "'abc' in ansible_facts.packages"
Another example I use:
- name: set fact for bootstrapper
set_fact:
bootstrapper: true
when: cluster.bootstrapper
- name: set fact for not bootstrapper
set_fact:
bootstrapper: false
when: not cluster.bootstrapper
Q: Is there a more efficient method to set all these facts in e.g. a single task?