Bring back 'value' in input data, fix ansible_template .value

'value' is artificial here, but it's easier to do than change all
Puppet run.pp/remove.pp files.
This commit is contained in:
Przemyslaw Kaminski 2015-09-14 16:24:06 +02:00
parent 88462db2fc
commit 5562b28027
3 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
$resource = hiera($::resource_name)
$port = "${resource['input']['port']}"
$management_port = "${resource['input']['management_port']}"
$port = "${resource['input']['port']['value']}"
$management_port = "${resource['input']['management_port']['value']}"
class { '::rabbitmq':
service_manage => true,

View File

@ -67,10 +67,10 @@ class AnsibleTemplate(TempFileHandler):
# XXX: r.args['ssh_user'] should be something different in this case probably
inventory = '{0} ansible_connection=local user={1} {2}'
host, user = 'localhost', r.args['ssh_user'].value
host, user = 'localhost', r.args['ssh_user']
args = []
for arg in r.args:
args.append('{0}="{1}"'.format(arg, r.args[arg].value))
args.append('{0}="{1}"'.format(arg, r.args[arg]))
args = ' '.join(args)
inventory = inventory.format(host, user, args)
log.debug(inventory)

View File

@ -116,7 +116,11 @@ class Resource(object):
def to_dict(self):
ret = self.db_obj.to_dict()
ret['input'] = self.args
ret['input'] = {}
for k, v in self.args.items():
ret['input'][k] = {
'value': v,
}
return ret