From d4335cc52e0569b7e5ac9720b10ddbecaede0995 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 21 Sep 2020 11:18:28 +0300 Subject: [PATCH] set chmod -R 777 /opt --- .../scripts/installers/post-deployment.sh | 11 ++++++++ images/linux/ubuntu1604.json | 25 ++++++++++++------- images/linux/ubuntu1804.json | 25 ++++++++++++------- images/linux/ubuntu2004.json | 7 ++++++ 4 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 images/linux/scripts/installers/post-deployment.sh diff --git a/images/linux/scripts/installers/post-deployment.sh b/images/linux/scripts/installers/post-deployment.sh new file mode 100644 index 000000000..10fe34feb --- /dev/null +++ b/images/linux/scripts/installers/post-deployment.sh @@ -0,0 +1,11 @@ +#!/bin/bash +################################################################################ +## File: post-deployment.sh +## Desc: Post deployment actions +################################################################################ + +# set chmod -R 777 /opt +if [[ -d "/opt" ]]; then + echo "chmod -R 777 /opt" + chmod -R 777 /opt +fi diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 33263345a..111f87f0d 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -301,15 +301,6 @@ "destination": "{{template_dir}}/Ubuntu1604-README.md", "direction": "download" }, - { - "type": "shell", - "inline": [ - "rm -rf {{user `helper_script_folder`}}", - "rm -rf {{user `installer_script_folder`}}", - "chmod 755 {{user `image_folder`}}" - ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, { "type": "shell", "scripts":[ @@ -319,6 +310,22 @@ "RUN_VALIDATION={{user `run_validation_diskspace`}}" ] }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/post-deployment.sh" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "inline": [ + "rm -rf {{user `helper_script_folder`}}", + "rm -rf {{user `installer_script_folder`}}", + "chmod 755 {{user `image_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "file", "source": "{{template_dir}}/config/ubuntu1604.conf", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 1dd62bc2d..d62de1e48 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -305,15 +305,6 @@ "destination": "{{template_dir}}/Ubuntu1804-README.md", "direction": "download" }, - { - "type": "shell", - "inline": [ - "rm -rf {{user `helper_script_folder`}}", - "rm -rf {{user `installer_script_folder`}}", - "chmod 755 {{user `image_folder`}}" - ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, { "type": "shell", "scripts":[ @@ -323,6 +314,22 @@ "RUN_VALIDATION={{user `run_validation_diskspace`}}" ] }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/post-deployment.sh" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "inline": [ + "rm -rf {{user `helper_script_folder`}}", + "rm -rf {{user `installer_script_folder`}}", + "chmod 755 {{user `image_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "file", "source": "{{template_dir}}/config/ubuntu1804.conf", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 67d6e1d6a..5a0f77609 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -316,6 +316,13 @@ "RUN_VALIDATION={{user `run_validation_diskspace`}}" ] }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/post-deployment.sh" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "shell", "inline": [