include a sanitized version of unit_name and relation name in Ansible's host_vars

Bug #1390535 reported by Patrick Hetu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned

Bug Description

Right now, I'm using something like this:

- name: set sanitized_unit_name
  set_fact: sanitized_unit_name="{{ local_unit | regex_replace('^(.*)/.*$', '\\1') | regex_replace('-', '_') }}"

- name: get relation name
  set_fact: relation_name="{{ ansible_env.JUJU_RELATION | regex_replace('(.*)-relation-.*','\\1') }}"
  when: ansible_env.JUJU_RELATION is defined

Since we do that a lot in charm it would be useful to do it in the library directly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.