diff --git a/examples/provisioning/provision.py b/examples/provisioning/provision.py index 9f83d5d3..c063b3ef 100755 --- a/examples/provisioning/provision.py +++ b/examples/provisioning/provision.py @@ -26,7 +26,7 @@ master_node = filter(lambda n: n.name == 'node_master', node_resources)[0] # Dnsmasq resources for node in nodes_list: dnsmasq = vr.create('dnsmasq_{0}'.format(node['mac'].replace(':', '_')), 'resources/dnsmasq', {})[0] - node = filter(lambda n: n.name.endswith('node{0}'.format(node['mac']).replace(':', '_')), node_resources)[0] + node = filter(lambda n: n.name.endswith('node_{0}'.format(node['mac']).replace(':', '_')), node_resources)[0] master_node.connect(dnsmasq) node.connect(dnsmasq, {'admin_mac': 'exclude_mac_pxe'}) diff --git a/templates/not_provisioned_nodes.yaml b/templates/not_provisioned_nodes.yaml index ff459ca0..894d4b5d 100644 --- a/templates/not_provisioned_nodes.yaml +++ b/templates/not_provisioned_nodes.yaml @@ -1,24 +1,25 @@ id: not_provisioned_nodes resources: {% for node in nodes %} - - id: ssh_transport{{ node.mac | replace(':', '_') }} + {% set mac = node.mac | replace(':', '_') %} + - id: ssh_transport{{ mac }} from: resources/transport_ssh values: ssh_user: 'root' ssh_key: '/vagrant/tmp/keys/ssh_private' - - id: transports{{node.mac | replace(':', '_') }} + - id: transports{{mac}} from: resources/transports values: - transports:key: ssh_transport{{node.mac | replace(':', '_') }}::ssh_key - transports:user: ssh_transport{{node.mac | replace(':', '_') }}::ssh_user - transports:port: ssh_transport{{node.mac | replace(':', '_') }}::ssh_port - transports:name: ssh_transport{{node.mac | replace(':', '_') }}::name - - id: node{{node.mac | replace(':', '_') }} + transports:key: ssh_transport{{mac}}::ssh_key + transports:user: ssh_transport{{mac}}::ssh_user + transports:port: ssh_transport{{mac}}::ssh_port + transports:name: ssh_transport{{mac}}::name + - id: node_{{mac}} from: resources/not_provisioned_node values: ip: {{node.ip}} - transports_id: transports{{node.mac | replace(':', '_') }}::transports_id - name: node{{node.mac | replace(':', '_') }} + transports_id: transports{{mac}}::transports_id + name: node_{{mac}} admin_mac: {{node.mac}} {% endfor %}