Skip to content

Commit

Permalink
[AL2023] Adding installation of rsyslog and enabling the service
Browse files Browse the repository at this point in the history
  • Loading branch information
Himani Deshpande committed May 1, 2024
1 parent b809f72 commit 09dcc00
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,13 @@ suites:
verifier:
controls:
- /tag:install_users/
- name: enable_services
run_list:
- recipe[aws-parallelcluster-tests::setup]
- recipe[aws-parallelcluster-platform::enable_services]
verifier:
controls:
- /install_service_is_enabled/
attributes:
dependencies:
- resource:install_packages:install_base_packages
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?
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def default_packages
libical-devel sendmail libxml2-devel libglvnd-devel
libgcrypt-devel libevent-devel glibc-static bind-utils
iproute python3 python3-pip libcurl-devel
coreutils environment-modules gcc gcc-c++ bzip2 iptables vim yum-plugin-versionlock)
coreutils environment-modules gcc gcc-c++ bzip2 iptables vim yum-plugin-versionlock rsyslog)
end

def unsupported_packages
Expand Down
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
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

0 comments on commit 09dcc00

Please sign in to comment.