~michael.nelson/charm-helpers/ansible-detect-hooks

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/templating/contexts.py

[r=noodles] Add unit private/public ips to default templating context for ansible helper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    # file resources etc.
68
68
    config['charm_dir'] = charm_dir
69
69
    config['local_unit'] = charmhelpers.core.hookenv.local_unit()
 
70
    config['unit_private_address'] = charmhelpers.core.hookenv.unit_private_ip()
 
71
    config['unit_public_address'] = charmhelpers.core.hookenv.unit_get(
 
72
        'public-address'
 
73
    )
70
74
 
71
75
    # Don't use non-standard tags for unicode which will not
72
76
    # work when salt uses yaml.load_safe.