hosts example is now using recent hash changes
This commit is contained in:
parent
2cd5d948c2
commit
98352143fc
@ -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',
|
||||
})
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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 %}
|
||||
|
@ -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!}]
|
||||
|
Loading…
Reference in New Issue
Block a user