Skip to content

Commit ca31f53

Browse files
committed
Add Rocky Linux to kitchen configuration files
Copied from rhel8 with minor changes: * AMI name prefix took from EC2 Rocky Linux official AMI * `kernel_release` version took from an EC2 Rocky Linux instance * username `rocky` found in kitchen-ec2 driver documentation. Added Rocky Linux to kitchen tests hooks ### References * https://hub.docker.com/r/dokken/rockylinux-8 * https://github.com/test-kitchen/kitchen-ec2/tree/main/lib/kitchen/driver/aws/standard_platform Signed-off-by: Enrico Usai <[email protected]>
1 parent fa315ca commit ca31f53

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

kitchen.docker.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,10 @@ platforms:
6969
cluster:
7070
base_os: rhel8
7171
kernel_release: '4.18.0-477.13.1.el8_7.fake-value' # Use 477 version to match 8.8 kernel version available on docker
72+
- name: rocky8
73+
driver:
74+
image: <% if ENV['KITCHEN_ROCKY8_IMAGE'] %> <%= ENV['KITCHEN_ROCKY8_IMAGE'] %> <% else %> dokken/rockylinux-8 <% end %>
75+
attributes:
76+
cluster:
77+
base_os: rocky8
78+
kernel_release: '4.18.0-477.10.1.el8_8.x86_64'

kitchen.ec2.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ lifecycle:
3838
3939
case $KITCHEN_PLATFORM_NAME in
4040
alinux*|redhat* ) export KITCHEN_EC2_USER='ec2-user';;
41+
rocky* ) export KITCHEN_EC2_USER='rocky';;
4142
centos* ) export KITCHEN_EC2_USER='centos';;
4243
ubuntu* ) export KITCHEN_EC2_USER='ubuntu';;
4344
esac
@@ -127,6 +128,32 @@ platforms:
127128
attributes:
128129
cluster:
129130
base_os: rhel8
131+
- name: rocky8
132+
driver_plugin: ec2
133+
driver:
134+
<% if ENV['KITCHEN_ROCKY8_AMI'] %>
135+
# Use the Rocky Linux 8 AMI most similar to the base AMI used to build the ParallelCluster image
136+
image_id: <%= ENV['KITCHEN_ROCKY8_AMI'] %>
137+
<% else %>
138+
image_search:
139+
name: <% if ENV['KITCHEN_PHASE']=='install' %>Rocky-8-EC2-Base-8*<% else %><%= pcluster_prefix %>-rocky8-hvm-*<% end %>
140+
architecture: <%= ENV['KITCHEN_ARCHITECTURE'] %>
141+
<% end %>
142+
block_device_mappings:
143+
- device_name: /dev/sda1
144+
ebs:
145+
volume_size: <% if (ENV['KITCHEN_VOLUME_SIZE'] || '') == '' %> 35 <% else %> <%= ENV['KITCHEN_VOLUME_SIZE'] %> <% end %>
146+
volume_type: gp2
147+
delete_on_termination: true
148+
<% %w(a b c d e f g h i j k l m n o p q r s t u v w x).each_with_index do | c, i | %>
149+
- device_name: /dev/xvdb<%= c %>
150+
virtual_name: ephemeral<%= i %>
151+
<% end %>
152+
transport:
153+
username: rocky
154+
attributes:
155+
cluster:
156+
base_os: rocky8
130157
- name: centos7
131158
driver_plugin: ec2
132159
driver:

kitchen/kitchen.run-hook.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if [ -e "${SCRIPT}" ]; then
2626
if [ -n "${KITCHEN_INSTANCE_HOSTNAME}" ]; then
2727
case ${KITCHEN_PLATFORM_NAME} in
2828
alinux*|redhat* ) export KITCHEN_EC2_USER='ec2-user';;
29+
rocky* ) export KITCHEN_EC2_USER='rocky';;
2930
centos* ) export KITCHEN_EC2_USER='centos';;
3031
ubuntu* ) export KITCHEN_EC2_USER='ubuntu';;
3132
esac

0 commit comments

Comments
 (0)