@@ -18,7 +18,7 @@ def self.configure(chef_run)
1818LAUNCH_TEMPLATE_ID = "LAUNCH_TEMPLATE_ID" . freeze
1919SCRIPT_DIR = "SCRIPT_DIR" . freeze
2020MONITOR_SHARED_DIR = "MONITOR_SHARED_DIR" . freeze
21- NODE_BOOTSTRAP_TIMEOUT = "1800"
21+ NODE_BOOTSTRAP_TIMEOUT = "1800" . freeze
2222
2323describe 'cfn_hup_configuration:configure' do
2424 for_all_oses do |platform , version |
@@ -29,8 +29,8 @@ def self.configure(chef_run)
2929 runner = runner ( platform : platform , version : version , step_into : [ 'cfn_hup_configuration' ] ) do |node |
3030 allow_any_instance_of ( Object ) . to receive ( :get_metadata_token ) . and_return ( "IMDS_TOKEN" )
3131 allow_any_instance_of ( Object ) . to receive ( :get_metadata_with_token )
32- . with ( "IMDS_TOKEN" , URI ( "http://169.254.169.254/latest/meta-data/iam/security-credentials" ) )
33- . and_return ( INSTANCE_ROLE_NAME )
32+ . with ( "IMDS_TOKEN" , URI ( "http://169.254.169.254/latest/meta-data/iam/security-credentials" ) )
33+ . and_return ( INSTANCE_ROLE_NAME )
3434 node . override [ "cluster" ] [ "node_type" ] = node_type
3535 node . override [ "cluster" ] [ "region" ] = AWS_REGION
3636 node . override [ "cluster" ] [ "aws_domain" ] = AWS_DOMAIN
@@ -49,63 +49,63 @@ def self.configure(chef_run)
4949 %w( /etc/cfn /etc/cfn/hooks.d ) . each do |dir |
5050 it "creates the directory #{ dir } " do
5151 is_expected . to create_directory ( dir )
52- . with ( owner : 'root' )
53- . with ( group : 'root' )
54- . with ( mode : "0700" )
55- . with ( recursive : true )
52+ . with ( owner : 'root' )
53+ . with ( group : 'root' )
54+ . with ( mode : "0700" )
55+ . with ( recursive : true )
5656 end
5757 end
5858
5959 it "creates the file /etc/cfn/cfn-hup.conf" do
6060 is_expected . to create_template ( "/etc/cfn/cfn-hup.conf" )
61- . with ( source : 'cfn_hup_configuration/cfn-hup.conf.erb' )
62- . with ( user : "root" )
63- . with ( group : "root" )
64- . with ( mode : "0400" )
65- . with ( variables : {
66- stack_id : STACK_ID ,
67- region : AWS_REGION ,
68- cloudformation_url : CLOUDFORMATION_URL ,
69- cfn_init_role : INSTANCE_ROLE_NAME ,
70- } )
61+ . with ( source : 'cfn_hup_configuration/cfn-hup.conf.erb' )
62+ . with ( user : "root" )
63+ . with ( group : "root" )
64+ . with ( mode : "0400" )
65+ . with ( variables : {
66+ stack_id : STACK_ID ,
67+ region : AWS_REGION ,
68+ cloudformation_url : CLOUDFORMATION_URL ,
69+ cfn_init_role : INSTANCE_ROLE_NAME ,
70+ } )
7171 end
7272
7373 it "creates the file /etc/cfn/hooks.d/pcluster-update.conf" do
7474 is_expected . to create_template ( "/etc/cfn/hooks.d/pcluster-update.conf" )
75- . with ( source : 'cfn_hup_configuration/cfn-hook-update.conf.erb' )
76- . with ( user : "root" )
77- . with ( group : "root" )
78- . with ( mode : "0400" )
79- . with ( variables : {
80- stack_id : STACK_ID ,
81- region : AWS_REGION ,
82- cloudformation_url : CLOUDFORMATION_URL ,
83- cfn_init_role : INSTANCE_ROLE_NAME ,
84- launch_template_resource_id : LAUNCH_TEMPLATE_ID ,
85- update_hook_script_dir : SCRIPT_DIR ,
86- node_bootstrap_timeout : NODE_BOOTSTRAP_TIMEOUT ,
87- } )
75+ . with ( source : 'cfn_hup_configuration/cfn-hook-update.conf.erb' )
76+ . with ( user : "root" )
77+ . with ( group : "root" )
78+ . with ( mode : "0400" )
79+ . with ( variables : {
80+ stack_id : STACK_ID ,
81+ region : AWS_REGION ,
82+ cloudformation_url : CLOUDFORMATION_URL ,
83+ cfn_init_role : INSTANCE_ROLE_NAME ,
84+ launch_template_resource_id : LAUNCH_TEMPLATE_ID ,
85+ update_hook_script_dir : SCRIPT_DIR ,
86+ node_bootstrap_timeout : NODE_BOOTSTRAP_TIMEOUT ,
87+ } )
8888 end
8989
9090 if %(ComputeFleet) . include? ( node_type )
9191 it "creates the file #{ SCRIPT_DIR } /cfn-hup-update-action.sh" do
9292 is_expected . to create_template ( "#{ SCRIPT_DIR } /cfn-hup-update-action.sh" )
93- . with ( source : "cfn_hup_configuration/#{ node_type } /cfn-hup-update-action.sh.erb" )
94- . with ( user : "root" )
95- . with ( group : "root" )
96- . with ( mode : "0700" )
97- . with ( variables : {
98- monitor_shared_dir : "#{ MONITOR_SHARED_DIR } /dna" ,
99- launch_template_resource_id : LAUNCH_TEMPLATE_ID ,
93+ . with ( source : "cfn_hup_configuration/#{ node_type } /cfn-hup-update-action.sh.erb" )
94+ . with ( user : "root" )
95+ . with ( group : "root" )
96+ . with ( mode : "0700" )
97+ . with ( variables : {
98+ monitor_shared_dir : "#{ MONITOR_SHARED_DIR } /dna" ,
99+ launch_template_resource_id : LAUNCH_TEMPLATE_ID ,
100100 } )
101101 end
102102 elsif node_type == 'HeadNode'
103103 it "creates #{ SCRIPT_DIR } /share_compute_fleet_dna.py" do
104104 is_expected . to create_if_missing_cookbook_file ( "#{ SCRIPT_DIR } /share_compute_fleet_dna.py" )
105- . with ( source : 'cfn_hup_configuration/share_compute_fleet_dna.py' )
106- . with ( user : 'root' )
107- . with ( group : 'root' )
108- . with ( mode : '0700' )
105+ . with ( source : 'cfn_hup_configuration/share_compute_fleet_dna.py' )
106+ . with ( user : 'root' )
107+ . with ( group : 'root' )
108+ . with ( mode : '0700' )
109109 end
110110
111111 it "creates the directory #{ MONITOR_SHARED_DIR } /dna" do
0 commit comments