-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
On Red Hat systems networkd is packaged as systemd-networkd. In particular: * EL7 * EL8/EL9 shipped in EPEL * Fedora since 33
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
systemd::networkd_package: systemd-networkd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'systemd with manage_networkd true' do | ||
has_package = fact('os.family') == 'RedHat' | ||
|
||
context 'configure systemd-networkd' do | ||
let(:manifest) do | ||
<<~PUPPET | ||
class { 'systemd': | ||
manage_networkd => true, | ||
} | ||
PUPPET | ||
end | ||
|
||
it 'works idempotently with no errors' do | ||
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 7
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 7
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 9
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 8
Check failure on line 17 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 8
|
||
apply_manifest(manifest, catch_failures: true) | ||
# Package systemd-networkd needs to be installed before fact $facts['internal_services'] is set | ||
apply_manifest(manifest, catch_failures: true) if has_package | ||
apply_manifest(manifest, catch_changes: true) | ||
end | ||
|
||
describe service('systemd-networkd') do | ||
it { is_expected.to be_running } | ||
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 7
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 7
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 9
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 8
Check failure on line 25 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 8
|
||
it { is_expected.to be_enabled } | ||
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 7
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 7
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 9
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 8
Check failure on line 26 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 8
|
||
end | ||
|
||
it { expect(package('systemd-networkd')).to be_installed } if has_package | ||
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 7
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 7
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 9
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 8
Check failure on line 29 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 8
|
||
end | ||
|
||
context 'configure systemd stopped' do | ||
let(:manifest) do | ||
<<~PUPPET | ||
class { 'systemd': | ||
manage_networkd => true, | ||
networkd_ensure => 'stopped', | ||
} | ||
PUPPET | ||
end | ||
|
||
it 'works idempotently with no errors' do | ||
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - Rocky 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - AlmaLinux 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 7
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 7
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - Rocky 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - OracleLinux 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - AlmaLinux 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 9
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - CentOS 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 7 - OracleLinux 8
Check failure on line 42 in spec/acceptance/networkd_spec.rb GitHub Actions / Puppet / 8 - CentOS 8
|
||
apply_manifest(manifest, catch_failures: true) | ||
apply_manifest(manifest, catch_changes: true) | ||
end | ||
|
||
describe service('systemd-networkd') do | ||
it { is_expected.not_to be_running } | ||
it { is_expected.not_to be_enabled } | ||
end | ||
end | ||
end |