diff --git a/examples/hosts_file/hosts.py b/examples/hosts_file/hosts.py index f7ba9f92..cf27b171 100644 --- a/examples/hosts_file/hosts.py +++ b/examples/hosts_file/hosts.py @@ -29,27 +29,27 @@ def run(): hosts1 = vr.create('hosts_file1', 'resources/hosts_file', {})[0] hosts2 = vr.create('hosts_file2', 'resources/hosts_file', {})[0] signals.connect(node1, hosts1, { - 'name': 'hosts_names', - 'ip': ['hosts_ips', 'ip'], + 'name': 'hosts:name', + 'ip': ['hosts:ip', 'ip'], 'ssh_user': 'ssh_user', 'ssh_key': 'ssh_key' }) signals.connect(node2, hosts2, { - 'name': 'hosts_names', - 'ip': ['hosts_ips', 'ip'], + 'name': 'hosts:name', + 'ip': ['hosts:ip', 'ip'], 'ssh_user': 'ssh_user', 'ssh_key': 'ssh_key' }) signals.connect(node1, hosts2, { - 'ip': 'hosts_ips', - 'name': 'hosts_names' + 'name': 'hosts:name', + 'ip': 'hosts:ip', }) signals.connect(node2, hosts1, { - 'ip': 'hosts_ips', - 'name': 'hosts_names' + 'name': 'hosts:name', + 'ip': 'hosts:ip', }) diff --git a/examples/riak/riaks.py b/examples/riak/riaks.py index 469ad1ef..f5df5251 100644 --- a/examples/riak/riaks.py +++ b/examples/riak/riaks.py @@ -195,7 +195,7 @@ def setup_haproxies(): local_errors = validation.validate_resource(r) if local_errors: has_errors = True - print 'ERROR: %s: %s' % (r.name, errors) + print 'ERROR: %s: %s' % (r.name, local_errors) if has_errors: print "ERRORS" diff --git a/resources/hosts_file/actions/run.yaml b/resources/hosts_file/actions/run.yaml index 68959684..b6f94195 100644 --- a/resources/hosts_file/actions/run.yaml +++ b/resources/hosts_file/actions/run.yaml @@ -1,11 +1,11 @@ - hosts: [{{host}}] sudo: yes tasks: - {% for ip, host in zip(hosts_ips, hosts_names) %} - - name: Create hosts entries for {{host}} => {{ip}} + {% for val in hosts %} + - name: Create hosts entries for {{val['name']}} => {{val['ip']}} lineinfile: dest: /etc/hosts - regexp: '.*{{host}}$' - line: '{{ip}} {{host}}' + regexp: '.*{{val['name']}}$' + line: '{{val['ip']}} {{val['name']}}' state: present {% endfor %} diff --git a/resources/hosts_file/meta.yaml b/resources/hosts_file/meta.yaml index d14f308b..b55243f3 100644 --- a/resources/hosts_file/meta.yaml +++ b/resources/hosts_file/meta.yaml @@ -12,9 +12,5 @@ input: ssh_user: schema: str! value: - hosts_names: - schema: [str!] - value: [] - hosts_ips: - schema: [str!] - value: [] + hosts: + schema: [{name: str!, ip: str!}]