From 3b20585ada7b5333d8ef6879d78124514436bbff Mon Sep 17 00:00:00 2001 From: jctanner Date: Fri, 4 Aug 2017 13:28:40 -0400 Subject: [PATCH] Fix 23417 (#27770) * Expose user_metadat to ansible * Fixed exception when no userData --- contrib/inventory/softlayer.py | 3 +++ 1 file changed, 3 insertions(+) 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