-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from ekohl/systemd-networkd-package
Install systemd-networkd package, if any
- Loading branch information
Showing
10 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
systemd::networkd_package: systemd-networkd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'systemd with manage_networkd true' do | ||
has_package = fact('os.family') == 'RedHat' | ||
|
||
# On Enterprise Linux 8 & 9 the package is shipped in EPEL | ||
before { install_package(default, 'epel-release') if has_package && %w[8 9].include?(fact('os.release.major')) } | ||
|
||
context 'configure systemd-networkd' do | ||
let(:manifest) do | ||
<<~PUPPET | ||
class { 'systemd': | ||
manage_networkd => true, | ||
} | ||
PUPPET | ||
end | ||
|
||
it 'works idempotently with no errors' do | ||
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 } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
it { expect(package('systemd-networkd')).to be_installed } if has_package | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters