-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AL2023] Adding installation of rsyslog and enabling the service
- Loading branch information
Himani Deshpande
committed
May 1, 2024
1 parent
b809f72
commit 09dcc00
Showing
5 changed files
with
63 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
27 changes: 27 additions & 0 deletions
27
cookbooks/aws-parallelcluster-platform/recipes/install/enable_services.rb
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,27 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# Cookbook:: aws-parallelcluster-platform | ||
# Recipe:: disable_services | ||
# | ||
# Copyright:: 2013-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the | ||
# License. A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# If the service does not exist the action disable does not return error. | ||
# Masking the service in order to prevent it from being automatically enabled if not installed yet. | ||
|
||
# on alinux2023, enable ryslog | ||
service 'rsyslog' do | ||
supports restart: true | ||
action %i(enable start) | ||
retries 5 | ||
retry_delay 10 | ||
end unless on_docker? |
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
16 changes: 16 additions & 0 deletions
16
cookbooks/aws-parallelcluster-platform/spec/unit/recipes/enable_services_spec.rb
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,16 @@ | ||
require 'spec_helper' | ||
|
||
describe 'aws-parallelcluster-platform::enable_services' do | ||
for_all_oses do |platform, version| | ||
context "on #{platform}#{version}" do | ||
cached(:chef_run) do | ||
runner(platform: platform, version: version).converge(described_recipe) | ||
end | ||
|
||
it 'enables ryslog' do | ||
is_expected.to enable_service('rsyslog') | ||
is_expected.to start_service('rsyslog') | ||
end | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
cookbooks/aws-parallelcluster-platform/test/controls/enable_services_spec.rb
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,9 @@ | ||
control 'tag:install_service_is_enabled' do | ||
only_if { !os_properties.on_docker? } | ||
|
||
describe service('rsyslog') do | ||
it { should be_installed } | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end |