diff --git a/manifests/plugins/ml2/networking_ansible.pp b/manifests/plugins/ml2/networking_ansible.pp index e3c235552..b46e8b95c 100644 --- a/manifests/plugins/ml2/networking_ansible.pp +++ b/manifests/plugins/ml2/networking_ansible.pp @@ -17,6 +17,7 @@ # "ansible_host" => "10.0.0.2", # "ansible_user" => 'ansible', # "ansible_ssh_private_key_file" => "/private/key", +# "mac" => "01:23:45:67:89:AB", # "manage_vlans" => false}, # } # diff --git a/manifests/plugins/ml2/networking_ansible_host.pp b/manifests/plugins/ml2/networking_ansible_host.pp index d45737391..934b0181f 100644 --- a/manifests/plugins/ml2/networking_ansible_host.pp +++ b/manifests/plugins/ml2/networking_ansible_host.pp @@ -22,10 +22,14 @@ # This or ansible_ssh_pass should be provided # # [*hostname*] -# (required) The hostname of a host connected to the switch. +# (required) The hostname of a host connected to the switch. +# +# [*mac*] +# Chassis MAC ID of the network device. Used to map lldp provided value +# to the hostname when using ironic introspection. # # [*manage_vlans*] -# Should networking-ansible create and delete VLANs on the device. +# Should networking-ansible create and delete VLANs on the device. # define neutron::plugins::ml2::networking_ansible_host( $ansible_network_os, @@ -33,6 +37,7 @@ define neutron::plugins::ml2::networking_ansible_host( $ansible_user, $ansible_ssh_pass = undef, $ansible_ssh_private_key_file = undef, + $mac = undef, $hostname = $title, $manage_vlans = undef, ) { @@ -51,6 +56,7 @@ define neutron::plugins::ml2::networking_ansible_host( "${section}/ansible_user": value => $ansible_user; "${section}/ansible_ssh_pass": value => $ansible_ssh_pass, secret => true; "${section}/ansible_ssh_private_key_file": value => $ansible_ssh_private_key_file; + "${section}/mac": value => $mac; "${section}/manage_vlans": value => $manage_vlans; } } diff --git a/releasenotes/notes/net-ansible-mac-189cb3b712b30a89.yaml b/releasenotes/notes/net-ansible-mac-189cb3b712b30a89.yaml new file mode 100644 index 000000000..1d8e377fc --- /dev/null +++ b/releasenotes/notes/net-ansible-mac-189cb3b712b30a89.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Added support for networking-ansible's mac parameter diff --git a/spec/classes/neutron_plugins_ml2_networking_ansible_spec.rb b/spec/classes/neutron_plugins_ml2_networking_ansible_spec.rb index 1cb4fcda1..89771f9cc 100644 --- a/spec/classes/neutron_plugins_ml2_networking_ansible_spec.rb +++ b/spec/classes/neutron_plugins_ml2_networking_ansible_spec.rb @@ -22,6 +22,7 @@ describe 'neutron::plugins::ml2::networking_ansible' do 'ansible_host' => '10.0.0.1', 'ansible_user' => 'ansible', 'ansible_ssh_private_key_file' => '/path/to/key', + 'mac' => '01:23:45:67:89:AB', 'manage_vlans' => false},} } end @@ -52,6 +53,9 @@ describe 'neutron::plugins::ml2::networking_ansible' do is_expected.to contain_neutron_plugin_ml2('ansible:host2/ansible_ssh_private_key_file').with_value('/path/to/key') is_expected.to contain_neutron_plugin_ml2('ansible:host2/ansible_ssh_pass').with_value(nil) + is_expected.to contain_neutron_plugin_ml2('ansible:host1/mac').with_value(nil) + is_expected.to contain_neutron_plugin_ml2('ansible:host2/mac').with_value('01:23:45:67:89:AB') + is_expected.to contain_neutron_plugin_ml2('ansible:host1/manage_vlans').with_value(nil) is_expected.to contain_neutron_plugin_ml2('ansible:host2/manage_vlans').with_value(false) end