From 8c8bda35b33c8288003d04f9f6dc3e541b776046 Mon Sep 17 00:00:00 2001 From: castrov <10415785+castrov@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:09:08 +0200 Subject: [PATCH] Add autoconnect_slaves parameter (#86) * Add autoconnect_slaves parameter --- CHANGELOG | 3 +++ REFERENCE.md | 9 +++++++++ manifests/eth.pp | 2 ++ metadata.json | 2 +- spec/defines/eth_spec.rb | 1 + spec/expected/everything_eth.el7 | 1 + spec/expected/everything_eth.el8 | 1 + templates/eth.erb | 4 ++++ 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4cc3acb..0897e9d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +* Sat Aug 12 2023 Daniel Castro <10415785+castrov@users.noreply.github.com> - 6.4.2 +- Add autoconnect_slaves parameter + * Wed Jul 19 2023 Chris Tessmer - 6.4.1 - Fix EL8 `dhclient` flags in eth template: - `-timeout ` (EL7) vs `--timeout` (EL8) diff --git a/REFERENCE.md b/REFERENCE.md index 8b1b342..49dff71 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -323,6 +323,7 @@ The following parameters are available in the `network::eth` defined type: * [`auto_discover_mac`](#-network--eth--auto_discover_mac) * [`bonding`](#-network--eth--bonding) * [`arp`](#-network--eth--arp) +* [`autoconnect_slaves`](#-network--eth--autoconnect_slaves) * [`bond_arp_interval`](#-network--eth--bond_arp_interval) * [`bond_arp_ip_target`](#-network--eth--bond_arp_ip_target) * [`bond_downdelay`](#-network--eth--bond_downdelay) @@ -423,6 +424,14 @@ Data type: `Optional[Boolean]` +Default value: `undef` + +##### `autoconnect_slaves` + +Data type: `Optional[Boolean]` + + + Default value: `undef` ##### `bond_arp_interval` diff --git a/manifests/eth.pp b/manifests/eth.pp index 219a460..55a1c1f 100755 --- a/manifests/eth.pp +++ b/manifests/eth.pp @@ -29,6 +29,7 @@ # ignored. # # @param arp +# @param autoconnect_slaves # @param bond_arp_interval # @param bond_arp_ip_target # @param bond_downdelay @@ -121,6 +122,7 @@ # define network::eth ( Optional[Boolean] $arp = undef, + Optional[Boolean] $autoconnect_slaves = undef, Boolean $auto_discover_mac = true, Boolean $bonding = false, Optional[Integer] $bond_arp_interval = undef, diff --git a/metadata.json b/metadata.json index 1189f9b..f86e3db 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-network", - "version": "6.4.1", + "version": "6.4.2", "author": "SIMP Team", "summary": "manages host networking", "license": "Apache-2.0", diff --git a/spec/defines/eth_spec.rb b/spec/defines/eth_spec.rb index ede33e1..0710fab 100644 --- a/spec/defines/eth_spec.rb +++ b/spec/defines/eth_spec.rb @@ -69,6 +69,7 @@ let(:title) { 'everything_eth' } let(:params) {{ :arp => true, + :autoconnect_slaves => true, :auto_discover_mac => true, :bonding => true, :bond_arp_interval => 5, diff --git a/spec/expected/everything_eth.el7 b/spec/expected/everything_eth.el7 index 3ce3ecc..b2dff7e 100644 --- a/spec/expected/everything_eth.el7 +++ b/spec/expected/everything_eth.el7 @@ -50,3 +50,4 @@ LINKDELAY=5 BRIDGE=br0 NM_CONTROLLED=no BONDING_OPTS='arp_interval=5 arp_ip_target=192.168.1.1 #lacp_rate=1 max_bonds=5 miimon=100 downdelay=2 updelay=3 mode=4 bond_use_carrier=1 xmit_hash_policy=layer2+3' +AUTOCONNECT_SLAVES=yes diff --git a/spec/expected/everything_eth.el8 b/spec/expected/everything_eth.el8 index f19462f..5c7639a 100644 --- a/spec/expected/everything_eth.el8 +++ b/spec/expected/everything_eth.el8 @@ -50,3 +50,4 @@ LINKDELAY=5 BRIDGE=br0 NM_CONTROLLED=no BONDING_OPTS='arp_interval=5 arp_ip_target=192.168.1.1 #lacp_rate=1 max_bonds=5 miimon=100 downdelay=2 updelay=3 mode=4 bond_use_carrier=1 xmit_hash_policy=layer2+3' +AUTOCONNECT_SLAVES=yes diff --git a/templates/eth.erb b/templates/eth.erb index 1563b4d..f720b93 100644 --- a/templates/eth.erb +++ b/templates/eth.erb @@ -258,5 +258,9 @@ unless t_bonding_options.empty? eth_opts << "BONDING_OPTS='#{t_bonding_options.join(' ')}'" end + + unless @autoconnect_slaves.nil? + eth_opts << "AUTOCONNECT_SLAVES=#{bool_to_yesno[@autoconnect_slaves]}" + end -%> <%= eth_opts.join("\n") %>