Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: "Setting place name of {{ country }}"
- set_fact:
- place: "get_place_name"
- - name: "Setting places name of {{ country }}"
- set_fact:
- places: "get_places_name"
- - name: Details of "{{ country }}"
- debug:
- msg: "{{ item }}"
- when:
- - place in "{{ item.Other_Places }}" or places in "{{ item.Other_Places }}"
- with_items: "{{ Places }}"
- ---
- Places:
- - Country: "{{ country }}"
- Capital: "{{ capital}}}"
- Other_Places: ['place1', 'place2']
- - Country: "{{ country }}"
- Capital: "{{ capital }}"
- Other_Places: ['places1', 'places2', 'places3', 'places4']
- "msg": {
- "Country": "United States of America",
- "Capital": "place1",
- "Other_Places": "['place1', 'place2']"
- }
- - name: Exceptional case
- debug:
- msg: "{{ capital }} not in {{ item.Capital }} "
- when:
- - place not in "{{ item.Other_Places }}" or places not in "{{ item.Other_Places }}"
- with_items: "{{ Places }}"
Add Comment
Please, Sign In to add comment