Skip to content

Commit

Permalink
Using cookbook virtual environment path for cfn-init command
Browse files Browse the repository at this point in the history
  • Loading branch information
Himani Deshpande committed Jun 13, 2024
1 parent e22ecc0 commit 2f1f43a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
region: node['cluster']['region'],
cloudformation_url: cloudformation_url,
cfn_init_role: instance_role_name,
launch_template_resource_id: node['cluster']['launch_template_id']
launch_template_resource_id: node['cluster']['launch_template_id'],
cfn_bootstrap_virtualenv_path: cookbook_virtualenv_path
)
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CLOUDFORMATION_URL = "https://cloudformation.#{AWS_REGION}.#{AWS_DOMAIN}"
INSTANCE_ROLE_NAME = "INSTANCE_ROLE_NAME"
LAUNCH_TEMPLATE_ID = "LAUNCH_TEMPLATE_ID"
CFN_BOOTSTRAP_VIRTUALENV_PATH = "CFN_BOOTSTRAP_VIRTUALENV_PATH"

for_all_oses do |platform, version|
context "on #{platform}#{version}" do
Expand Down Expand Up @@ -81,6 +82,7 @@
cloudformation_url: CLOUDFORMATION_URL,
cfn_init_role: INSTANCE_ROLE_NAME,
launch_template_resource_id: LAUNCH_TEMPLATE_ID,
cfn_bootstrap_virtualenv_path: CFN_BOOTSTRAP_VIRTUALENV_PATH,
})
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[parallelcluster-update]
triggers=post.update
path=Resources.<%= @launch_template_resource_id %>.Metadata.AWS::CloudFormation::Init
action=PATH=/usr/local/bin:/bin:/usr/bin:/opt/aws/bin; . /etc/profile.d/pcluster_cookbook_environment.sh; $CFN_BOOTSTRAP_VIRTUALENV_PATH/cfn-init -v --stack <%= @stack_id %> --resource <%= @launch_template_resource_id %> --configsets update --region <%= @region %> --url <%= @cloudformation_url %> --role <%= @cfn_init_role %>
action=PATH=/usr/local/bin:/bin:/usr/bin:/opt/aws/bin; . /etc/profile.d/pcluster_cookbook_environment.sh; <%= @cfn_bootstrap_virtualenv_path %>/bin/cfn-init -v --stack <%= @stack_id %> --resource <%= @launch_template_resource_id %> --configsets update --region <%= @region %> --url <%= @cloudformation_url %> --role <%= @cfn_init_role %>
runas=root

0 comments on commit 2f1f43a

Please sign in to comment.