Is there a way to apply dot notation against the 'environment_id' variable
so that I do it once and not have to apply it multiple times within my
file? What I really want is the value after I "grep" for the last two
character in the string (see debug statement).
- name: Get environment id
set_fact:
environment_id: "{{ lookup('ini','environment section=multidb
file=xyz.conf') }}"
*- debug: msg={{ environment_id[-2:] }}*
- name: Build list of modules
set_fact:
deploy_list: "{{ item | replace('deploys/' + environment_id + '/','')
}}-{{ lookup('consul_kv','deploys/' + environment_id + '/' + item) }}"
with_items: "{{ modules }}"
register: deploy_list_result
--
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/e8ad8933-e612-4127-bd39-bb166ab4af71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.