Small refactoring
diff --git a/baremetal_simulator/init.sls b/baremetal_simulator/init.sls
index 62f2051..ec8abbe 100644
--- a/baremetal_simulator/init.sls
+++ b/baremetal_simulator/init.sls
@@ -1,4 +1,4 @@
-{%- from "baremetal_simulator/map.jinja" import baremetal_simulator with context %}
+{%- from "baremetal_simulator/map.jinja" import baremetal_simulator,bs_nodes with context %}
{%- if baremetal_simulator.enabled %}
simulator_pkgs:
@@ -52,7 +52,7 @@
{%- endif %}
-{%- for identity_name, nodes in baremetal_simulator.nodes.iteritems() %}
+{%- for identity_name, nodes in bs_nodes.iteritems() %}
{%- for node in nodes %}
disk_create_node{{ loop.index }}:
@@ -83,14 +83,6 @@
- name: vbmc start {{ node.name }} > /dev/null 2>&1 && sleep 1
- unless: vbmc show {{ node.name }} | grep status |grep -q running
-node_{{ node.name }}_present:
- ironicng.node_present:
- - name: {{ node.name }}
- - driver: {{ node.driver }}
- - properties: {{ node.properties }}
- - profile: {{ identity_name }}
- - driver_info: {{ node.driver_info }}
-
{%- for port in node.ports %}
{{ node.name }}_tap_device_{{ loop.index }}:
@@ -103,11 +95,6 @@
- name: tap-{{ node.name }}i{{ loop.index }}
- bridge: br-simulator
-{{ node.name }}_port{{ loop.index }}_present:
- ironicng.port_present:
- - address: {{ port.address }}
- - node_name: {{ node.name }}
- - profile: {{ identity_name }}
{%- endfor %}
{%- endfor %}
diff --git a/baremetal_simulator/map.jinja b/baremetal_simulator/map.jinja
index 79f1427..1ef3600 100644
--- a/baremetal_simulator/map.jinja
+++ b/baremetal_simulator/map.jinja
@@ -1,6 +1,8 @@
{% set baremetal_simulator = salt['grains.filter_by']({
'Common': {
'pkgs': ['python-pip', 'openvswitch-switch', 'libvirt-bin'],
- 'pip_pkgs': ['virtualbmc']
+ 'pip_pkgs': ['virtualbmc'],
}
}, base='Common', merge=pillar.get('baremetal_simulator', {})) %}
+
+{%- set bs_nodes = pillar.get('ironic', {}).get('client', {}).get('nodes', {}) %}
diff --git a/metadata/service/simulator.yml b/metadata/service/simulator.yml
index 9e45118..3dd12fd 100644
--- a/metadata/service/simulator.yml
+++ b/metadata/service/simulator.yml
@@ -11,54 +11,6 @@
cirros_image_name: cirros-0.3.5-x86_64-disk.img
cirros_image_ref: http://download.cirros-cloud.net/0.3.5/${baremetal_simulator:cirros_image_name}
cirros_image_checksum: f8ab98ff5e73ebab884d80c9dc9c7290
- nodes:
- admin_identity:
- - name: n0
- driver: agent_ipmitool
- properties:
- local_gb: 10
- cpus: 2
- memory_mb: 1024
- driver_info:
- ipmi_username: admin
- ipmi_password: password
- ipmi_address: ${_param:single_address}
- ipmi_port: 6200
- deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
- deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
- ports:
- - address: aa:bb:cc:dd:00:00
- - address: aa:bb:cc:dd:00:01
- - name: n1
- driver: agent_ipmitool
- properties:
- local_gb: 10
- cpus: 2
- memory_mb: 1024
- driver_info:
- ipmi_username: admin
- ipmi_password: password
- ipmi_address: ${_param:single_address}
- ipmi_port: 6201
- deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
- deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
- ports:
- - address: aa:bb:cc:dd:01:00
- - name: n2
- driver: agent_ipmitool
- properties:
- local_gb: 10
- cpus: 2
- memory_mb: 1024
- driver_info:
- ipmi_username: admin
- ipmi_password: password
- ipmi_address: ${_param:single_address}
- ipmi_port: 6202
- deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
- deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
- ports:
- - address: aa:bb:cc:dd:02:00
ironic:
client:
enabled: true
@@ -75,6 +27,59 @@
key0: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEvr+tWAJ62wROllpSZeaSPxxnVY3R65sfUW8wM6L8tr1knJOTQLoBikmcjISb3ekyPlwubTypGoxb7al06FiNwfr3KDkytflKRGTyMKYgchighuFCfBuePd13cjf1l19TYU7u7a+VuCVWi7pmhDGUkMi24s23OroQb7D14XX17v46wLrqJQi2nrXzN/DWXcn/ycq8IZ7ZFgN/uYlbpfAKX8PCvImbDDO8+BgndAy4MPz8cWOWsnfGMVNePhvhazVcijLvx8Vu2Iuvg7CoJiSGjTe7YTms44/WpnFkHreyK8cwsw4wzls4BApu6UU2jIAsAMZh9zux/Rtni71dcNfF
network:
name: baremetal-flat-network
+ nodes:
+ admin_identity:
+ - name: n0
+ driver: agent_ipmitool
+ properties:
+ local_gb: 10
+ cpus: 2
+ memory_mb: 1024
+ driver_info:
+ ipmi_username: admin
+ ipmi_password: password
+ ipmi_address: ${_param:single_address}
+ ipmi_port: 6200
+ deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
+ deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
+ ports:
+ - address: aa:bb:cc:dd:00:00
+ - address: aa:bb:cc:dd:00:01
+ - name: n1
+ driver: agent_ipmitool
+ properties:
+ local_gb: 10
+ cpus: 2
+ memory_mb: 1024
+ driver_info:
+ ipmi_username: admin
+ ipmi_password: password
+ ipmi_address: ${_param:single_address}
+ ipmi_port: 6201
+ deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
+ deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
+ ports:
+ - address: aa:bb:cc:dd:01:00
+ deployment_profile:
+ network:
+ fixed_ips:
+ - ip_address: 192.168.90.111
+ subnet_name: baremetal-subnet
+ - name: n2
+ driver: agent_ipmitool
+ properties:
+ local_gb: 10
+ cpus: 2
+ memory_mb: 1024
+ driver_info:
+ ipmi_username: admin
+ ipmi_password: password
+ ipmi_address: ${_param:single_address}
+ ipmi_port: 6202
+ deploy_ramdisk: http://${_param:single_address}/${baremetal_simulator:deploy_ramdisk_file}
+ deploy_kernel: http://${_param:single_address}/${baremetal_simulator:deploy_kernel_file}
+ ports:
+ - address: aa:bb:cc:dd:02:00
linux:
network:
interface: