summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorjctanner <tanner.jc@gmail.com>2017-08-04 19:28:40 +0200
committerSloane Hertel <shertel@redhat.com>2017-08-04 19:28:40 +0200
commit3b20585ada7b5333d8ef6879d78124514436bbff (patch)
tree33a4ea99df8b658f93ef2968d67a3291676aa071 /contrib
parentMinor edit (diff)
downloadansible-3b20585ada7b5333d8ef6879d78124514436bbff.tar.xz
ansible-3b20585ada7b5333d8ef6879d78124514436bbff.zip
Fix 23417 (#27770)
* Expose user_metadat to ansible * Fixed exception when no userData
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/inventory/softlayer.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/inventory/softlayer.py b/contrib/inventory/softlayer.py
index 4d78f58b26..b1e915f74a 100755
--- a/contrib/inventory/softlayer.py
+++ b/contrib/inventory/softlayer.py
@@ -53,6 +53,7 @@ class SoftLayerInventory(object):
'primaryIpAddress',
'datacenter',
'tagReferences.tag.name',
+ 'userData.value',
]
vs_items = [
@@ -137,6 +138,8 @@ class SoftLayerInventory(object):
if 'primaryIpAddress' not in instance:
return
+ instance['userData'] = instance['userData'][0]['value'] if instance['userData'] else ''
+
dest = instance['primaryIpAddress']
self.inventory["_meta"]["hostvars"][dest] = instance