From 5f9c49ab2b0876372f57443da376f6daa62428a5 Mon Sep 17 00:00:00 2001 From: Default User Date: Thu, 14 Dec 2023 23:06:37 +1100 Subject: [PATCH] SYSO-139 added step to install jq package --- docs/Build-Linux-Machine-with-PiKVM.html | 155 ++++++++++++++---- docs/Build-Windows-Machine-with-PiKVM.html | 155 ++++++++++++++---- .../metadata.json | 12 ++ .../script.txt | 35 ++++ .../metadata.json | 18 +- 5 files changed, 302 insertions(+), 73 deletions(-) create mode 100644 steps/confirmcommandlinejsonprocessorisinstalled/metadata.json create mode 100644 steps/confirmcommandlinejsonprocessorisinstalled/script.txt diff --git a/docs/Build-Linux-Machine-with-PiKVM.html b/docs/Build-Linux-Machine-with-PiKVM.html index bda09c1..5cbf2fc 100644 --- a/docs/Build-Linux-Machine-with-PiKVM.html +++ b/docs/Build-Linux-Machine-with-PiKVM.html @@ -213,9 +213,17 @@
+

+ + Step 1.1 - Confirm Command-line JSON processor is installed + +

+ + +

- Step 1.1 - Test PiKVM Authentication + Step 1.2 - Test PiKVM Authentication

@@ -223,7 +231,7 @@

- Step 1.2 - Get PiKVM System Info + Step 1.3 - Get PiKVM System Info

@@ -231,7 +239,7 @@

- Step 1.3 - Get ATX State + Step 1.4 - Get ATX State

@@ -239,7 +247,7 @@

- Step 1.4 - Set ATX Power Soft Off + Step 1.5 - Set ATX Power Soft Off

@@ -247,7 +255,7 @@

- Step 1.5 - Get MSD State + Step 1.6 - Get MSD State

@@ -255,7 +263,7 @@

- Step 1.6 - Disconnect MSD Image + Step 1.7 - Disconnect MSD Image

@@ -263,7 +271,7 @@

- Step 1.7 - Reset MSD State + Step 1.8 - Reset MSD State

@@ -271,7 +279,7 @@

- Step 1.8 - Remove MSD Image + Step 1.9 - Remove MSD Image

@@ -279,7 +287,7 @@

- Step 1.9 - Upload MSD Image + Step 1.10 - Upload MSD Image

@@ -287,7 +295,7 @@

- Step 1.10 - Select MSD Image + Step 1.11 - Select MSD Image

@@ -295,7 +303,7 @@

- Step 1.11 - Connect MSD + Step 1.12 - Connect MSD

@@ -303,7 +311,7 @@

- Step 1.12 - Set ATX Power On + Step 1.13 - Set ATX Power On

@@ -460,20 +468,13 @@

-
-
-

- -

-
-
@@ -501,6 +502,94 @@

+
+

+ Execute the following script: +

+
+
+
+
+                
+if [[ -f /etc/redhat-release ]] || [[ -f /etc/lsb-release ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        dnf -y install jq
+    fi
+
+elif [[ -f /etc/debian_version ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        apt-get -y install jq
+    fi
+
+elif [[ "Darwin" == "$(uname)" ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        brew -y install jq
+    fi
+
+else
+    
+    echo "Unsupported operating system."
+    exit 1
+fi
+                
+            
+
+
+ + + + + + + + + + + +
+
+

+ +

+
+
+ + + + + + + + + + + + + + + +

Execute the following script: @@ -540,7 +629,7 @@

@@ -607,7 +696,7 @@

@@ -664,7 +753,7 @@

@@ -723,7 +812,7 @@

@@ -782,7 +871,7 @@

@@ -841,7 +930,7 @@

@@ -899,7 +988,7 @@

@@ -957,7 +1046,7 @@

@@ -1018,7 +1107,7 @@

@@ -1077,7 +1166,7 @@

@@ -1136,7 +1225,7 @@

diff --git a/docs/Build-Windows-Machine-with-PiKVM.html b/docs/Build-Windows-Machine-with-PiKVM.html index 6658041..a3ce9f1 100644 --- a/docs/Build-Windows-Machine-with-PiKVM.html +++ b/docs/Build-Windows-Machine-with-PiKVM.html @@ -213,9 +213,17 @@

+

+ + Step 1.1 - Confirm Command-line JSON processor is installed + +

+ + +

- Step 1.1 - Test PiKVM Authentication + Step 1.2 - Test PiKVM Authentication

@@ -223,7 +231,7 @@

- Step 1.2 - Get PiKVM System Info + Step 1.3 - Get PiKVM System Info

@@ -231,7 +239,7 @@

- Step 1.3 - Get ATX State + Step 1.4 - Get ATX State

@@ -239,7 +247,7 @@

- Step 1.4 - Set ATX Power Soft Off + Step 1.5 - Set ATX Power Soft Off

@@ -247,7 +255,7 @@

- Step 1.5 - Get MSD State + Step 1.6 - Get MSD State

@@ -255,7 +263,7 @@

- Step 1.6 - Disconnect MSD Image + Step 1.7 - Disconnect MSD Image

@@ -263,7 +271,7 @@

- Step 1.7 - Reset MSD State + Step 1.8 - Reset MSD State

@@ -271,7 +279,7 @@

- Step 1.8 - Remove MSD Image + Step 1.9 - Remove MSD Image

@@ -279,7 +287,7 @@

- Step 1.9 - Upload MSD Image + Step 1.10 - Upload MSD Image

@@ -287,7 +295,7 @@

- Step 1.10 - Select MSD Image + Step 1.11 - Select MSD Image

@@ -295,7 +303,7 @@

- Step 1.11 - Connect MSD + Step 1.12 - Connect MSD

@@ -303,7 +311,7 @@

- Step 1.12 - Set ATX Power On + Step 1.13 - Set ATX Power On

@@ -484,20 +492,13 @@

-
-
-

- -

-
-
@@ -525,6 +526,94 @@

+
+

+ Execute the following script: +

+
+
+
+
+                
+if [[ -f /etc/redhat-release ]] || [[ -f /etc/lsb-release ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        dnf -y install jq
+    fi
+
+elif [[ -f /etc/debian_version ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        apt-get -y install jq
+    fi
+
+elif [[ "Darwin" == "$(uname)" ]]
+then
+
+    if which jq >/dev/null; then
+        echo "jq is installed."
+    else
+        echo "jq is not installed."
+        brew -y install jq
+    fi
+
+else
+    
+    echo "Unsupported operating system."
+    exit 1
+fi
+                
+            
+
+
+ + + + + + + + + + + +
+
+

+ +

+
+
+ + + + + + + + + + + + + + + +

Execute the following script: @@ -564,7 +653,7 @@

@@ -631,7 +720,7 @@

@@ -688,7 +777,7 @@

@@ -747,7 +836,7 @@

@@ -806,7 +895,7 @@

@@ -865,7 +954,7 @@

@@ -923,7 +1012,7 @@

@@ -981,7 +1070,7 @@

@@ -1042,7 +1131,7 @@

@@ -1101,7 +1190,7 @@

@@ -1160,7 +1249,7 @@

diff --git a/steps/confirmcommandlinejsonprocessorisinstalled/metadata.json b/steps/confirmcommandlinejsonprocessorisinstalled/metadata.json new file mode 100644 index 0000000..d8f9654 --- /dev/null +++ b/steps/confirmcommandlinejsonprocessorisinstalled/metadata.json @@ -0,0 +1,12 @@ +{ + "actionOnStepFail": null, + "enabled": true, + "externalUuid4": "7cde9620-89e6-4462-b032-59cc8f13ab9b", + "interpreter": 1, + "key": "confirmcommandlinejsonprocessorisinstalled", + "name": "Confirm Command-line JSON processor is installed", + "osCredKey": "automationworkerlinuxuser", + "serverKey": "automationworkerlinuxnode", + "successExitCode": 0, + "type": "com.servertribe.attune.tuples.StepSshTuple" +} \ No newline at end of file diff --git a/steps/confirmcommandlinejsonprocessorisinstalled/script.txt b/steps/confirmcommandlinejsonprocessorisinstalled/script.txt new file mode 100644 index 0000000..a69ea91 --- /dev/null +++ b/steps/confirmcommandlinejsonprocessorisinstalled/script.txt @@ -0,0 +1,35 @@ +if [[ -f /etc/redhat-release ]] || [[ -f /etc/lsb-release ]] +then + + if which jq >/dev/null; then + echo "jq is installed." + else + echo "jq is not installed." + dnf -y install jq + fi + +elif [[ -f /etc/debian_version ]] +then + + if which jq >/dev/null; then + echo "jq is installed." + else + echo "jq is not installed." + apt-get -y install jq + fi + +elif [[ "Darwin" == "$(uname)" ]] +then + + if which jq >/dev/null; then + echo "jq is installed." + else + echo "jq is not installed." + brew -y install jq + fi + +else + + echo "Unsupported operating system." + exit 1 +fi \ No newline at end of file diff --git a/steps/preparepikvmandstartosinstallation/metadata.json b/steps/preparepikvmandstartosinstallation/metadata.json index a725a9d..c725b3b 100644 --- a/steps/preparepikvmandstartosinstallation/metadata.json +++ b/steps/preparepikvmandstartosinstallation/metadata.json @@ -8,34 +8,38 @@ "links": [ { "order": 0, - "stepKey": "testpikvmauthentication" + "stepKey": "confirmcommandlinejsonprocessorisinstalled" }, { "order": 50, - "stepKey": "getpikvmsysteminfo" + "stepKey": "testpikvmauthentication" }, { "order": 100, - "stepKey": "getatxstate" + "stepKey": "getpikvmsysteminfo" }, { "order": 150, - "stepKey": "setatxpowersoftoff" + "stepKey": "getatxstate" }, { "order": 200, - "stepKey": "getmsdstate" + "stepKey": "setatxpowersoftoff" }, { "order": 250, - "stepKey": "disconnectmsdimage" + "stepKey": "getmsdstate" }, { "order": 300, - "stepKey": "resetmsdstate" + "stepKey": "disconnectmsdimage" }, { "order": 350, + "stepKey": "resetmsdstate" + }, + { + "order": 400, "stepKey": "removemsdimage" }, {