From b5d3c29b67230591c3c37f1b8addd21aced473fe Mon Sep 17 00:00:00 2001 From: Matthew Bays Date: Tue, 16 Apr 2024 13:40:39 -0400 Subject: [PATCH] Group working directory scripts after reboot --- templates/al2/template.json | 58 ++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/templates/al2/template.json b/templates/al2/template.json index 88983b7b7..aa8135159 100644 --- a/templates/al2/template.json +++ b/templates/al2/template.json @@ -125,17 +125,41 @@ { "type": "shell", "remote_folder": "{{ user `remote_folder`}}", - "inline": [ - "mkdir -p {{user `working_dir`}}", - "mkdir -p {{user `working_dir`}}/log-collector-script" + "script": "{{template_dir}}/provisioners/install-additional-repos.sh", + "environment_vars": [ + "ADDITIONAL_YUM_REPOS={{user `additional_yum_repos`}}" ] }, { "type": "shell", "remote_folder": "{{ user `remote_folder`}}", - "script": "{{template_dir}}/provisioners/install-additional-repos.sh", + "script": "{{template_dir}}/provisioners/upgrade-kernel.sh", "environment_vars": [ - "ADDITIONAL_YUM_REPOS={{user `additional_yum_repos`}}" + "KUBERNETES_VERSION={{user `kubernetes_version`}}", + "KERNEL_VERSION={{user `kernel_version`}}" + ] + }, + { + "type": "shell", + "remote_folder": "{{ user `remote_folder`}}", + "script": "{{template_dir}}/provisioners/enable-fips.sh", + "environment_vars": [ + "ENABLE_FIPS={{user `enable_fips`}}" + ] + }, + { + "type": "shell", + "remote_folder": "{{ user `remote_folder`}}", + "inline": ["sudo reboot"], + "expect_disconnect": true, + "pause_after": "90s" + }, + { + "type": "shell", + "remote_folder": "{{ user `remote_folder`}}", + "inline": [ + "mkdir -p {{user `working_dir`}}", + "mkdir -p {{user `working_dir`}}/log-collector-script" ] }, { @@ -161,30 +185,6 @@ "sudo mv {{user `working_dir`}}/bin/* /usr/bin/" ] }, - { - "type": "shell", - "remote_folder": "{{ user `remote_folder`}}", - "script": "{{template_dir}}/provisioners/upgrade-kernel.sh", - "environment_vars": [ - "KUBERNETES_VERSION={{user `kubernetes_version`}}", - "KERNEL_VERSION={{user `kernel_version`}}" - ] - }, - { - "type": "shell", - "remote_folder": "{{ user `remote_folder`}}", - "script": "{{template_dir}}/provisioners/enable-fips.sh", - "environment_vars": [ - "ENABLE_FIPS={{user `enable_fips`}}" - ] - }, - { - "type": "shell", - "remote_folder": "{{ user `remote_folder`}}", - "inline": ["sudo reboot"], - "expect_disconnect": true, - "pause_after": "90s" - }, { "type": "shell", "remote_folder": "{{ user `remote_folder`}}",