diff options
author | Jon Clausen <jac@nordu.net> | 2018-08-02 12:38:12 +0200 |
---|---|---|
committer | Jon Clausen <jac@nordu.net> | 2018-08-02 12:38:12 +0200 |
commit | 2fa7121f3fa0add707e7be2d0e23c8fc950c0fe1 (patch) | |
tree | 5f574ed1283aae08cb469903584060d86db1329b | |
parent | a69b7887558f37e28a7ac2bea70b207bece3a7fa (diff) |
support for "CosmosTag"
-rwxr-xr-x | adapt-ks-template | 6 | ||||
-rw-r--r-- | ks-template/hw/dell/R7425/100g-dtn.ks | 2 | ||||
-rw-r--r-- | ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks | 2 | ||||
-rwxr-xr-x | prep-boot-floppy-and-ks-config | 15 |
4 files changed, 20 insertions, 5 deletions
diff --git a/adapt-ks-template b/adapt-ks-template index afc31e3..6514745 100755 --- a/adapt-ks-template +++ b/adapt-ks-template @@ -29,6 +29,7 @@ Options: -M, --netmask Netmask of target system -N, --nameserver Nameserver of target system -P, --publish-path Path where results will be stored + --cosmos-tag Tag in ndn-sysconf to reference --template Template to use. This is a relative path, plus the name of the template file. Default: ${Template} @@ -96,6 +97,10 @@ function parse_commadline { Kserver="$2" shift ;; + --cosmos-tag) + CosmosTag="${2}" + shift + ;; --template) Template="${2}" shift @@ -213,6 +218,7 @@ sed -ie '4 a #' "${TmpDir}/ks-template" # substitutions: sed -ie "s/HOSTNAME/${Host}/g" "${TmpDir}/ks-template" sed -ie "s/DOMAIN/${Domain}/g" "${TmpDir}/ks-template" +sed -ie "s/COSMOSTAG/${CosmosTag}/g" "${TmpDir}/ks-template" sed -ie "s/INSTALLSERVER/${Kserver}/g" "${TmpDir}/ks-template" sed -ie "s/PRIIP/${IP}/g" "${TmpDir}/ks-template" sed -ie "s/PRINETMASK/${NM}/g" "${TmpDir}/ks-template" diff --git a/ks-template/hw/dell/R7425/100g-dtn.ks b/ks-template/hw/dell/R7425/100g-dtn.ks index ac79841..20bf830 100644 --- a/ks-template/hw/dell/R7425/100g-dtn.ks +++ b/ks-template/hw/dell/R7425/100g-dtn.ks @@ -81,7 +81,7 @@ then else curl -o /bin/cosmos-bootstrap "https://git.nordu.net/?p=ndn-iaas.git;a=blob_plain;f=bootstrap/cosmos-bootstrap;hb=HEAD" chmod +x /bin/cosmos-bootstrap - /bin/cosmos-bootstrap "http://gitproxy.nordu.net/ndn-sysconf.git" ${CosmosHash} HOSTNAME.DOMAIN + /bin/cosmos-bootstrap "http://gitproxy.nordu.net/ndn-sysconf.git" ${CosmosHash} COSMOSTAG fi # return to the first vt diff --git a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks index 14a6935..2c49d9b 100644 --- a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks +++ b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks @@ -75,7 +75,7 @@ then else curl -o /bin/cosmos-bootstrap "https://git.nordu.net/?p=ndn-iaas.git;a=blob_plain;f=bootstrap/cosmos-bootstrap;hb=HEAD" chmod +x /bin/cosmos-bootstrap - /bin/cosmos-bootstrap "http://gitproxy.nordu.net/ndn-sysconf.git" ${CosmosHash} HOSTNAME.DOMAIN + /bin/cosmos-bootstrap "http://gitproxy.nordu.net/ndn-sysconf.git" ${CosmosHash} COSMOSTAG fi # return to the first vt chvt 1 diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config index 852545c..9befc42 100755 --- a/prep-boot-floppy-and-ks-config +++ b/prep-boot-floppy-and-ks-config @@ -41,6 +41,7 @@ Options: -N, --nameserver Nameserver of target system -P, --publish-path Path where results will be stored -S, --cosmos-hash Hash used by cosmos to verify stuff + --cosmos-tag Tag in ndn-sysconf to reference --template Template to use. This is a relative path, plus the name of the template file. Example: supermicro/SYS-5018D-FN8T/dtn-10g.ks @@ -110,6 +111,10 @@ function parse_commadline { CosmosHash="$2" shift ;; + --cosmos-tag) + CosmosTag="${2}" + shift + ;; --sec-ip) SecIP="${2}" shift @@ -147,7 +152,7 @@ function check_options { # mandatory/needed if [ "x${Domain}" = "x" ] then - echo "${Self}: --domain is mandatory" + echo "${Self}: --domain is mandatory" print_usage exit 1 fi @@ -192,6 +197,10 @@ function check_options { CosmosHash="2f15e1edb02f14607084f167929bc145ed47954d" fi # optional/defaults: + if [ ! "x${CosmosTag}" = "x" ] + then + CosmosTagOpt="--cosmos-tag ${CosmosTag}" + fi if [ "x${Kserver}" = "x" ] then Kserver="109.105.122.84" @@ -222,8 +231,8 @@ ${ScriptPath}/create-boot-floppy -D ${Domain} -G ${GW} -H ${Host} \ ${ScriptPath}/adapt-ks-template -D ${Domain} -G ${GW} -H ${Host} \ -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --sec-ip ${SecIP} \ - --sec-nm ${SecNM} ${TemplateOpt} ${KrnlCmdLineOpt} \ - --gen-cmd ${SelfCommandLine} + --sec-nm ${SecNM} ${TemplateOpt} ${KrnlCmdLineOpt} ${CosmosTagOpt} \ + --gen-cmd ${SelfCommandLine} # When this script calls the other two, PublishPath *is* set, so expect # everything of value to be evacuated, and just clean up: |