From 0808664aeddf2bd55cfa199a9141e2c9910e829b Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Thu, 26 Oct 2017 11:09:27 -0500 Subject: [PATCH 01/25] First move things into the two new parts. Next up renaming --- .gitignore | 2 ++ .travis.yml | 6 ++-- content/._Description.meta | 1 + content/._Name.meta | 1 + content/._Source.meta | 1 + content/._Version.meta | 1 + .../bootenvs}/ce-centos-7.4.1708.yml | 0 .../bootenvs}/ce-debian-8.yml | 0 .../bootenvs}/ce-debian-9.yml | 0 .../bootenvs}/ce-discovery.yml | 0 .../bootenvs}/ce-sledgehammer.yml | 0 .../bootenvs}/ce-ubuntu-16.04.yml | 0 .../profiles}/ce-root-access.yml | 0 .../templates}/ce-centos-7.ks.tmpl | 0 .../templates}/ce-default-elilo.tmpl | 0 .../templates}/ce-default-ipxe.tmpl | 0 .../templates}/ce-default-pxelinux.tmpl | 0 .../templates}/ce-net-post-install.sh.tmpl | 0 .../templates}/ce-net-seed.tmpl | 0 .../templates}/ce-root-remote-access.tmpl | 0 .../templates}/ce-set-hostname.tmpl | 0 .../templates}/ce-update-drp-local.tmpl | 0 .../templates}/part-scheme-ce-default.tmpl | 0 contrib/._Description.meta | 1 + contrib/._Name.meta | 1 + contrib/._Source.meta | 1 + contrib/._Version.meta | 1 + tools/package.sh | 30 +++++-------------- tools/publish.sh | 2 +- 29 files changed, 22 insertions(+), 26 deletions(-) create mode 100644 content/._Description.meta create mode 100644 content/._Name.meta create mode 100644 content/._Source.meta create mode 100644 content/._Version.meta rename {bootenvs => content/bootenvs}/ce-centos-7.4.1708.yml (100%) rename {bootenvs => content/bootenvs}/ce-debian-8.yml (100%) rename {bootenvs => content/bootenvs}/ce-debian-9.yml (100%) rename {bootenvs => content/bootenvs}/ce-discovery.yml (100%) rename {bootenvs => content/bootenvs}/ce-sledgehammer.yml (100%) rename {bootenvs => content/bootenvs}/ce-ubuntu-16.04.yml (100%) rename {profiles => content/profiles}/ce-root-access.yml (100%) rename {templates => content/templates}/ce-centos-7.ks.tmpl (100%) rename {templates => content/templates}/ce-default-elilo.tmpl (100%) rename {templates => content/templates}/ce-default-ipxe.tmpl (100%) rename {templates => content/templates}/ce-default-pxelinux.tmpl (100%) rename {templates => content/templates}/ce-net-post-install.sh.tmpl (100%) rename {templates => content/templates}/ce-net-seed.tmpl (100%) rename {templates => content/templates}/ce-root-remote-access.tmpl (100%) rename {templates => content/templates}/ce-set-hostname.tmpl (100%) rename {templates => content/templates}/ce-update-drp-local.tmpl (100%) rename {templates => content/templates}/part-scheme-ce-default.tmpl (100%) create mode 100644 contrib/._Description.meta create mode 100644 contrib/._Name.meta create mode 100644 contrib/._Source.meta create mode 100644 contrib/._Version.meta diff --git a/.gitignore b/.gitignore index f4bd0fb8..e2714eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ drp-community-content.sha256 drp-community-content.yaml +drp-community-contrib.sha256 +drp-community-contrib.yaml key1* key2* e-info.tgz diff --git a/.travis.yml b/.travis.yml index c9fd39db..9edfdf59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,11 @@ branches: - gh-pages sudo: false go: -- 1.8 +- 1.9 addons: apt: packages: - sshpass - - bsdtar - - p7zip-full script: - mkdir -p ~/.ssh - cp tools/ssh-config ~/.ssh/config @@ -29,6 +27,8 @@ deploy: file: - drp-community-content.yaml - drp-community-content.sha256 + - drp-community-contrib.yaml + - drp-community-contrib.sha256 skip_cleanup: true on: repo: digitalrebar/provision-content diff --git a/content/._Description.meta b/content/._Description.meta new file mode 100644 index 00000000..3a284790 --- /dev/null +++ b/content/._Description.meta @@ -0,0 +1 @@ +Digital Rebar Provision Community Content \ No newline at end of file diff --git a/content/._Name.meta b/content/._Name.meta new file mode 100644 index 00000000..38900fae --- /dev/null +++ b/content/._Name.meta @@ -0,0 +1 @@ +drp-community-content \ No newline at end of file diff --git a/content/._Source.meta b/content/._Source.meta new file mode 100644 index 00000000..d3b119f2 --- /dev/null +++ b/content/._Source.meta @@ -0,0 +1 @@ +https://github.com/digitalrebar/provision-content \ No newline at end of file diff --git a/content/._Version.meta b/content/._Version.meta new file mode 100644 index 00000000..5d210523 --- /dev/null +++ b/content/._Version.meta @@ -0,0 +1 @@ +v1.0.0-tip-galthaus-dev-16-b0c42db46653826e33c02b5697bf80841c2b5060 \ No newline at end of file diff --git a/bootenvs/ce-centos-7.4.1708.yml b/content/bootenvs/ce-centos-7.4.1708.yml similarity index 100% rename from bootenvs/ce-centos-7.4.1708.yml rename to content/bootenvs/ce-centos-7.4.1708.yml diff --git a/bootenvs/ce-debian-8.yml b/content/bootenvs/ce-debian-8.yml similarity index 100% rename from bootenvs/ce-debian-8.yml rename to content/bootenvs/ce-debian-8.yml diff --git a/bootenvs/ce-debian-9.yml b/content/bootenvs/ce-debian-9.yml similarity index 100% rename from bootenvs/ce-debian-9.yml rename to content/bootenvs/ce-debian-9.yml diff --git a/bootenvs/ce-discovery.yml b/content/bootenvs/ce-discovery.yml similarity index 100% rename from bootenvs/ce-discovery.yml rename to content/bootenvs/ce-discovery.yml diff --git a/bootenvs/ce-sledgehammer.yml b/content/bootenvs/ce-sledgehammer.yml similarity index 100% rename from bootenvs/ce-sledgehammer.yml rename to content/bootenvs/ce-sledgehammer.yml diff --git a/bootenvs/ce-ubuntu-16.04.yml b/content/bootenvs/ce-ubuntu-16.04.yml similarity index 100% rename from bootenvs/ce-ubuntu-16.04.yml rename to content/bootenvs/ce-ubuntu-16.04.yml diff --git a/profiles/ce-root-access.yml b/content/profiles/ce-root-access.yml similarity index 100% rename from profiles/ce-root-access.yml rename to content/profiles/ce-root-access.yml diff --git a/templates/ce-centos-7.ks.tmpl b/content/templates/ce-centos-7.ks.tmpl similarity index 100% rename from templates/ce-centos-7.ks.tmpl rename to content/templates/ce-centos-7.ks.tmpl diff --git a/templates/ce-default-elilo.tmpl b/content/templates/ce-default-elilo.tmpl similarity index 100% rename from templates/ce-default-elilo.tmpl rename to content/templates/ce-default-elilo.tmpl diff --git a/templates/ce-default-ipxe.tmpl b/content/templates/ce-default-ipxe.tmpl similarity index 100% rename from templates/ce-default-ipxe.tmpl rename to content/templates/ce-default-ipxe.tmpl diff --git a/templates/ce-default-pxelinux.tmpl b/content/templates/ce-default-pxelinux.tmpl similarity index 100% rename from templates/ce-default-pxelinux.tmpl rename to content/templates/ce-default-pxelinux.tmpl diff --git a/templates/ce-net-post-install.sh.tmpl b/content/templates/ce-net-post-install.sh.tmpl similarity index 100% rename from templates/ce-net-post-install.sh.tmpl rename to content/templates/ce-net-post-install.sh.tmpl diff --git a/templates/ce-net-seed.tmpl b/content/templates/ce-net-seed.tmpl similarity index 100% rename from templates/ce-net-seed.tmpl rename to content/templates/ce-net-seed.tmpl diff --git a/templates/ce-root-remote-access.tmpl b/content/templates/ce-root-remote-access.tmpl similarity index 100% rename from templates/ce-root-remote-access.tmpl rename to content/templates/ce-root-remote-access.tmpl diff --git a/templates/ce-set-hostname.tmpl b/content/templates/ce-set-hostname.tmpl similarity index 100% rename from templates/ce-set-hostname.tmpl rename to content/templates/ce-set-hostname.tmpl diff --git a/templates/ce-update-drp-local.tmpl b/content/templates/ce-update-drp-local.tmpl similarity index 100% rename from templates/ce-update-drp-local.tmpl rename to content/templates/ce-update-drp-local.tmpl diff --git a/templates/part-scheme-ce-default.tmpl b/content/templates/part-scheme-ce-default.tmpl similarity index 100% rename from templates/part-scheme-ce-default.tmpl rename to content/templates/part-scheme-ce-default.tmpl diff --git a/contrib/._Description.meta b/contrib/._Description.meta new file mode 100644 index 00000000..4db4a467 --- /dev/null +++ b/contrib/._Description.meta @@ -0,0 +1 @@ +Digital Rebar Provision Community Contrib \ No newline at end of file diff --git a/contrib/._Name.meta b/contrib/._Name.meta new file mode 100644 index 00000000..f139ea5d --- /dev/null +++ b/contrib/._Name.meta @@ -0,0 +1 @@ +drp-community-contrib \ No newline at end of file diff --git a/contrib/._Source.meta b/contrib/._Source.meta new file mode 100644 index 00000000..d3b119f2 --- /dev/null +++ b/contrib/._Source.meta @@ -0,0 +1 @@ +https://github.com/digitalrebar/provision-content \ No newline at end of file diff --git a/contrib/._Version.meta b/contrib/._Version.meta new file mode 100644 index 00000000..5d210523 --- /dev/null +++ b/contrib/._Version.meta @@ -0,0 +1 @@ +v1.0.0-tip-galthaus-dev-16-b0c42db46653826e33c02b5697bf80841c2b5060 \ No newline at end of file diff --git a/tools/package.sh b/tools/package.sh index 9c1613eb..afefab19 100755 --- a/tools/package.sh +++ b/tools/package.sh @@ -8,14 +8,10 @@ if [[ $(uname -m) == x86_64 ]] ; then fi case $(uname -s) in Darwin) - binpath="bin/darwin/$family" shasum="command shasum -a 256" - tar="command bsdtar" ;; Linux) - binpath="bin/linux/$family" shasum="command sha256sum" - tar="command bsdtar" ;; *) # Someday, support installing on Windows. Service creation could be tricky. @@ -23,24 +19,14 @@ case $(uname -s) in exit 1;; esac -if [ ! -e drp ] ; then - mkdir -p drp - cd drp - - DRP_VERSION=tip - echo "Installing Version $DRP_VERSION of Digital Rebar Provision" - curl -sfL -o dr-provision.zip https://github.com/digitalrebar/provision/releases/download/$DRP_VERSION/dr-provision.zip - curl -sfL -o dr-provision.sha256 https://github.com/digitalrebar/provision/releases/download/$DRP_VERSION/dr-provision.sha256 - $shasum -c dr-provision.sha256 - $tar -xf dr-provision.zip - - rm -f drpcli - ln -s $binpath/drpcli drpcli - - cd .. -fi +go get -u github.com/digitalrebar/provision/cmds/drbundler +PATH=$PATH:$GOPATH/bin . tools/version.sh -drp/drpcli contents bundle drp-community-content.yaml Description="Digital Rebar Provision Community Content" Version="$Prepart$MajorV.$MinorV.$PatchV$Extra-$GITHASH" Source="https://github.com/digitalrebar/provision-content" Name="drp-community-content" --format=yaml -$shasum drp-community-content.yaml > drp-community-content.sha256 +for dir in content contrib ; do + echo -n "$Prepart$MajorV.$MinorV.$PatchV$Extra-$GITHASH" > $dir/._Version.meta + drbundler $dir drp-community-$dir.yaml + $shasum drp-community-$dir.yaml > drp-community-$dir.sha256 +done + diff --git a/tools/publish.sh b/tools/publish.sh index 41eae8c6..717598c3 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -11,7 +11,7 @@ go get -u github.com/stevenroose/remarshal version="$Prepart$MajorV.$MinorV.$PatchV$Extra-$GITHASH" TOKEN=R0cketSk8ts -for i in drp-community-content ; do +for i in drp-community-content drp-community-contrib ; do echo "Publishing $i to cloud" CONTENT=$i remarshal -i $CONTENT.yaml -o $CONTENT.json -if yaml -of json From 01a178d81d32fef0ab52fd9d2fcf222bfda87aea Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Thu, 26 Oct 2017 11:28:18 -0500 Subject: [PATCH 02/25] Add build notes about files. --- TRAVIS_BUILD_NOTES | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 TRAVIS_BUILD_NOTES diff --git a/TRAVIS_BUILD_NOTES b/TRAVIS_BUILD_NOTES new file mode 100644 index 00000000..fba46ce1 --- /dev/null +++ b/TRAVIS_BUILD_NOTES @@ -0,0 +1,23 @@ + +This is some notes to remind Greg about how this gets built in travis. + +e-info.tgz.enc is an encrypted tar ball that contains the following files: + cicd + cicd.pub + dr_info + +cicd and cicd.pub are private/public keys that are registered with RackN to be injected into the +created nodes in packet. all the test commands use those keys. + +dr_info is the packet variables needed to drive packet - API key and Project key + +These are tarred up and encrypt by travis with a key in travis land. + +.travis.yaml uses the key in travis and the encrypted tarball to run unit tests if enabled. + +On Greg's laptop there are unencrypyt files and the base travis keys. + +If this needs to be updated, travis command from cli can be used to re-encrypt the file. +This would be accompanied with an update to .travis.yaml to make sure we use the correct +key in travis. This is non-obvious and a little tricky. + From 5d229bfbb6d6198aa7cff3ad0d796e913022135b Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Thu, 26 Oct 2017 14:20:03 -0500 Subject: [PATCH 03/25] First pass at merging content --- content/._Version.meta | 2 +- ...entos-7.4.1708.yml => centos-7.4.1708.yml} | 10 +-- content/bootenvs/centos-7.yml | 30 ++++++++ .../{ce-debian-8.yml => debian-8.yml} | 13 ++-- .../{ce-debian-9.yml => debian-9.yml} | 12 +-- .../{ce-discovery.yml => discovery.yml} | 5 +- .../{ce-sledgehammer.yml => sledgehammer.yml} | 9 +-- .../{ce-ubuntu-16.04.yml => ubuntu-16.04.yml} | 15 ++-- content/params/access-keys.yaml | 17 ++++ content/params/access-ssh-root-mode.yaml | 19 +++++ content/params/change-stage.map.yaml | 17 ++++ content/params/gohai-inventory.yaml | 7 ++ content/params/kernel-console.yaml | 15 ++++ ...oot-access.yml => root-access-example.yml} | 2 +- content/stages/centos-7.4.1708.yml | 12 +++ content/stages/centos-7.yml | 12 +++ content/stages/complete-nowait.yaml | 8 ++ content/stages/complete.yml | 8 ++ content/stages/debian-8.yml | 12 +++ content/stages/debian-9.yml | 12 +++ content/stages/discover.yaml | 16 ++++ content/stages/finish-install.yaml | 10 +++ content/stages/sledgehammer-wait.yaml | 9 +++ content/stages/ssh-access.yaml | 14 ++++ content/stages/ubuntu-16.04.yml | 12 +++ content/tasks/centos-drp-only-repos.yaml | 13 ++++ content/tasks/change-stage.yaml | 13 ++++ content/tasks/gohai.yaml | 13 ++++ content/tasks/set-hostname.yaml | 12 +++ content/tasks/ssh-access.yaml | 13 ++++ content/tasks/ubuntu-drp-only-repos.yaml | 13 ++++ ...remote-access.tmpl => access-keys.sh.tmpl} | 28 ++++++- content/templates/ce-update-drp-local.tmpl | 24 ------ .../{ce-centos-7.ks.tmpl => centos-7.ks.tmpl} | 7 +- .../templates/centos-drp-only-repos.sh.tmpl | 34 ++++++++ content/templates/change-stage.sh.tmpl | 77 +++++++++++++++++++ ...-default-elilo.tmpl => default-elilo.tmpl} | 0 ...ce-default-ipxe.tmpl => default-ipxe.tmpl} | 2 +- ...lt-pxelinux.tmpl => default-pxelinux.tmpl} | 2 +- ...stall.sh.tmpl => net-post-install.sh.tmpl} | 4 +- .../{ce-net-seed.tmpl => net-seed.tmpl} | 29 ++++++- ...-default.tmpl => part-scheme-default.tmpl} | 0 content/templates/runner.tmpl | 21 +++++ ...set-hostname.tmpl => set-hostname.sh.tmpl} | 1 + .../templates/ubuntu-drp-only-repos.sh.tmpl | 33 ++++++++ contrib/._Version.meta | 2 +- contrib/bootenvs/centos-6.8.yml | 31 ++++++++ contrib/bootenvs/centos-7.3.1611.yml | 31 ++++++++ contrib/bootenvs/scientificlinux-6.8.yml | 31 ++++++++ contrib/bootenvs/ubuntu-14.04.yml | 41 ++++++++++ contrib/stages/centos-6.8.yml | 12 +++ contrib/stages/centos-7.3.1611.yml | 12 +++ contrib/stages/scientificlinux-6.8.yml | 12 +++ contrib/stages/ubuntu-14.04.yml | 12 +++ contrib/templates/centos-6.ks.tmpl | 57 ++++++++++++++ 55 files changed, 804 insertions(+), 74 deletions(-) rename content/bootenvs/{ce-centos-7.4.1708.yml => centos-7.4.1708.yml} (84%) create mode 100644 content/bootenvs/centos-7.yml rename content/bootenvs/{ce-debian-8.yml => debian-8.yml} (88%) rename content/bootenvs/{ce-debian-9.yml => debian-9.yml} (88%) rename content/bootenvs/{ce-discovery.yml => discovery.yml} (97%) rename content/bootenvs/{ce-sledgehammer.yml => sledgehammer.yml} (90%) rename content/bootenvs/{ce-ubuntu-16.04.yml => ubuntu-16.04.yml} (85%) create mode 100644 content/params/access-keys.yaml create mode 100644 content/params/access-ssh-root-mode.yaml create mode 100644 content/params/change-stage.map.yaml create mode 100644 content/params/gohai-inventory.yaml create mode 100644 content/params/kernel-console.yaml rename content/profiles/{ce-root-access.yml => root-access-example.yml} (96%) create mode 100644 content/stages/centos-7.4.1708.yml create mode 100644 content/stages/centos-7.yml create mode 100644 content/stages/complete-nowait.yaml create mode 100644 content/stages/complete.yml create mode 100644 content/stages/debian-8.yml create mode 100644 content/stages/debian-9.yml create mode 100644 content/stages/discover.yaml create mode 100644 content/stages/finish-install.yaml create mode 100644 content/stages/sledgehammer-wait.yaml create mode 100644 content/stages/ssh-access.yaml create mode 100644 content/stages/ubuntu-16.04.yml create mode 100644 content/tasks/centos-drp-only-repos.yaml create mode 100644 content/tasks/change-stage.yaml create mode 100644 content/tasks/gohai.yaml create mode 100644 content/tasks/set-hostname.yaml create mode 100644 content/tasks/ssh-access.yaml create mode 100644 content/tasks/ubuntu-drp-only-repos.yaml rename content/templates/{ce-root-remote-access.tmpl => access-keys.sh.tmpl} (60%) delete mode 100644 content/templates/ce-update-drp-local.tmpl rename content/templates/{ce-centos-7.ks.tmpl => centos-7.ks.tmpl} (89%) create mode 100644 content/templates/centos-drp-only-repos.sh.tmpl create mode 100644 content/templates/change-stage.sh.tmpl rename content/templates/{ce-default-elilo.tmpl => default-elilo.tmpl} (100%) rename content/templates/{ce-default-ipxe.tmpl => default-ipxe.tmpl} (97%) rename content/templates/{ce-default-pxelinux.tmpl => default-pxelinux.tmpl} (93%) rename content/templates/{ce-net-post-install.sh.tmpl => net-post-install.sh.tmpl} (91%) rename content/templates/{ce-net-seed.tmpl => net-seed.tmpl} (82%) rename content/templates/{part-scheme-ce-default.tmpl => part-scheme-default.tmpl} (100%) create mode 100644 content/templates/runner.tmpl rename content/templates/{ce-set-hostname.tmpl => set-hostname.sh.tmpl} (97%) create mode 100644 content/templates/ubuntu-drp-only-repos.sh.tmpl create mode 100644 contrib/bootenvs/centos-6.8.yml create mode 100644 contrib/bootenvs/centos-7.3.1611.yml create mode 100644 contrib/bootenvs/scientificlinux-6.8.yml create mode 100644 contrib/bootenvs/ubuntu-14.04.yml create mode 100644 contrib/stages/centos-6.8.yml create mode 100644 contrib/stages/centos-7.3.1611.yml create mode 100644 contrib/stages/scientificlinux-6.8.yml create mode 100644 contrib/stages/ubuntu-14.04.yml create mode 100644 contrib/templates/centos-6.ks.tmpl diff --git a/content/._Version.meta b/content/._Version.meta index 5d210523..e0886980 100644 --- a/content/._Version.meta +++ b/content/._Version.meta @@ -1 +1 @@ -v1.0.0-tip-galthaus-dev-16-b0c42db46653826e33c02b5697bf80841c2b5060 \ No newline at end of file +v1.0.0-tip-galthaus-dev-18-01a178d81d32fef0ab52fd9d2fcf222bfda87aea \ No newline at end of file diff --git a/content/bootenvs/ce-centos-7.4.1708.yml b/content/bootenvs/centos-7.4.1708.yml similarity index 84% rename from content/bootenvs/ce-centos-7.4.1708.yml rename to content/bootenvs/centos-7.4.1708.yml index 6ce344a7..7af602ce 100644 --- a/content/bootenvs/ce-centos-7.4.1708.yml +++ b/content/bootenvs/centos-7.4.1708.yml @@ -1,5 +1,5 @@ --- -Name: "ce-centos-7.4.1708-install" +Name: "centos-7.4.1708-install" OS: Name: "centos-7.4.1708" IsoFile: "CentOS-7-x86_64-Minimal-1708.iso" @@ -16,15 +16,15 @@ OptionalParams: - "access-keys" - "kernel-console" Templates: - - ID: "ce-default-pxelinux.tmpl" + - ID: "default-pxelinux.tmpl" Name: "pxelinux" Path: "pxelinux.cfg/{{.Machine.HexAddress}}" - - ID: "ce-default-elilo.tmpl" + - ID: "default-elilo.tmpl" Name: "elilo" Path: "{{.Machine.HexAddress}}.conf" - - ID: "ce-default-ipxe.tmpl" + - ID: "default-ipxe.tmpl" Name: "ipxe" Path: "{{.Machine.Address}}.ipxe" - - ID: "ce-centos-7.ks.tmpl" + - ID: "centos-7.ks.tmpl" Name: "compute.ks" Path: "{{.Machine.Path}}/compute.ks" diff --git a/content/bootenvs/centos-7.yml b/content/bootenvs/centos-7.yml new file mode 100644 index 00000000..78b2ce8f --- /dev/null +++ b/content/bootenvs/centos-7.yml @@ -0,0 +1,30 @@ +--- +Name: "centos-7-install" +OS: + Name: "centos-7" + IsoFile: "CentOS-7-x86_64-Minimal-1708.iso" + IsoSha256: "bba314624956961a2ea31dd460cd860a77911c1e0a56e4820a12b9c5dad363f5" + IsoUrl: "http://mirrors.kernel.org/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso" +Kernel: "images/pxeboot/vmlinuz" +Initrds: + - "images/pxeboot/initrd.img" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} inst.geoloc=0 -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +RequiredParams: +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "access-keys" + - "kernel-console" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "centos-7.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/content/bootenvs/ce-debian-8.yml b/content/bootenvs/debian-8.yml similarity index 88% rename from content/bootenvs/ce-debian-8.yml rename to content/bootenvs/debian-8.yml index c4297866..cf7dffa6 100644 --- a/content/bootenvs/ce-debian-8.yml +++ b/content/bootenvs/debian-8.yml @@ -1,5 +1,5 @@ --- -Name: "ce-debian-8-install" +Name: "debian-8-install" OS: Name: "debian-8" Family: "debian" @@ -41,19 +41,20 @@ OptionalParams: - "provisioner-default-password-hash" - "access-keys" - "kernel-console" + - "proxy-servers" Templates: - - ID: "ce-default-pxelinux.tmpl" + - ID: "default-pxelinux.tmpl" Name: "pxelinux" Path: "pxelinux.cfg/{{.Machine.HexAddress}}" - - ID: "ce-default-elilo.tmpl" + - ID: "default-elilo.tmpl" Name: "elilo" Path: "{{.Machine.HexAddress}}.conf" - - ID: "ce-default-ipxe.tmpl" + - ID: "default-ipxe.tmpl" Name: "ipxe" Path: "{{.Machine.Address}}.ipxe" - - ID: "ce-net-seed.tmpl" + - ID: "net-seed.tmpl" Name: "seed" Path: "{{.Machine.Path}}/seed" - - ID: "ce-net-post-install.sh.tmpl" + - ID: "net-post-install.sh.tmpl" Name: "net-post-install.sh" Path: "{{.Machine.Path}}/post-install.sh" diff --git a/content/bootenvs/ce-debian-9.yml b/content/bootenvs/debian-9.yml similarity index 88% rename from content/bootenvs/ce-debian-9.yml rename to content/bootenvs/debian-9.yml index dbcccb1e..0db3d1f5 100644 --- a/content/bootenvs/ce-debian-9.yml +++ b/content/bootenvs/debian-9.yml @@ -1,5 +1,5 @@ --- -Name: "ce-debian-9-install" +Name: "debian-9-install" OS: Name: "debian-9" Family: "debian" @@ -42,18 +42,18 @@ OptionalParams: - "access-keys" - "kernel-console" Templates: - - ID: "ce-default-pxelinux.tmpl" + - ID: "default-pxelinux.tmpl" Name: "pxelinux" Path: "pxelinux.cfg/{{.Machine.HexAddress}}" - - ID: "ce-default-elilo.tmpl" + - ID: "default-elilo.tmpl" Name: "elilo" Path: "{{.Machine.HexAddress}}.conf" - - ID: "ce-default-ipxe.tmpl" + - ID: "default-ipxe.tmpl" Name: "ipxe" Path: "{{.Machine.Address}}.ipxe" - - ID: "ce-net-seed.tmpl" + - ID: "net-seed.tmpl" Name: "seed" Path: "{{.Machine.Path}}/seed" - - ID: "ce-net-post-install.sh.tmpl" + - ID: "net-post-install.sh.tmpl" Name: "net-post-install.sh" Path: "{{.Machine.Path}}/post-install.sh" diff --git a/content/bootenvs/ce-discovery.yml b/content/bootenvs/discovery.yml similarity index 97% rename from content/bootenvs/ce-discovery.yml rename to content/bootenvs/discovery.yml index cb1ef370..362cf78a 100644 --- a/content/bootenvs/ce-discovery.yml +++ b/content/bootenvs/discovery.yml @@ -1,5 +1,5 @@ --- -Name: "ce-discovery" +Name: "discovery" Description: "The boot environment to use to have unknown machines boot to Sledgehammer" OnlyUnknown: true OS: @@ -109,8 +109,7 @@ Templates: # Add the default noderoles we will need, and # Let the annealer do its thing. while ! json="$(drpcli machines create "{\"Name\": \"$HOSTNAME\", - \"Address\": \"$IP\", - \"BootEnv\": \"ce-sledgehammer\"}")"; do + \"Address\": \"$IP\"}")"; do echo "We could not create a node for ourself, trying again." sleep 5 done diff --git a/content/bootenvs/ce-sledgehammer.yml b/content/bootenvs/sledgehammer.yml similarity index 90% rename from content/bootenvs/ce-sledgehammer.yml rename to content/bootenvs/sledgehammer.yml index c3464d59..2d77b404 100644 --- a/content/bootenvs/ce-sledgehammer.yml +++ b/content/bootenvs/sledgehammer.yml @@ -2,7 +2,7 @@ # Sledgehammer (the per machine bootenv) # This bootenv requires the start-up.sh file to be rendered by the discovery bootenv. # These two bootenvs are linked and should be used as a pair. -Name: "ce-sledgehammer" +Name: "sledgehammer" OS: Name: "sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15" IsoFile: "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar" @@ -72,12 +72,7 @@ Templates: export PS4="${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): " cp /usr/share/zoneinfo/GMT /etc/localtime - {{template "ce-root-remote-access.tmpl" .}} - - # Set up just enough infrastructure to let the jigs work. - # Allow client to pass http proxy environment variables - echo "AcceptEnv http_proxy https_proxy no_proxy" >> /etc/ssh/sshd_config - service sshd restart + {{template "runner.tmpl" .}} # The last line in this script must always be exit 0!! exit 0 diff --git a/content/bootenvs/ce-ubuntu-16.04.yml b/content/bootenvs/ubuntu-16.04.yml similarity index 85% rename from content/bootenvs/ce-ubuntu-16.04.yml rename to content/bootenvs/ubuntu-16.04.yml index ee43256a..ee769e1f 100644 --- a/content/bootenvs/ce-ubuntu-16.04.yml +++ b/content/bootenvs/ubuntu-16.04.yml @@ -1,5 +1,5 @@ --- -Name: "ce-ubuntu-16.04-install" +Name: "ubuntu-16.04-install" OS: Name: "ubuntu-16.04" Family: "ubuntu" @@ -22,19 +22,22 @@ OptionalParams: - "provisioner-default-user" - "access-keys" - "kernel-console" + - "proxy-servers" + - "ntp-servers" + - "dns-domain" Templates: - - ID: "ce-default-pxelinux.tmpl" + - ID: "default-pxelinux.tmpl" Name: "pxelinux" Path: "pxelinux.cfg/{{.Machine.HexAddress}}" - - ID: "ce-default-elilo.tmpl" + - ID: "default-elilo.tmpl" Name: "elilo" Path: "{{.Machine.HexAddress}}.conf" - - ID: "ce-default-ipxe.tmpl" + - ID: "default-ipxe.tmpl" Name: "ipxe" Path: "{{.Machine.Address}}.ipxe" - - ID: "ce-net-seed.tmpl" + - ID: "net-seed.tmpl" Name: "seed" Path: "{{.Machine.Path}}/seed" - - ID: "ce-net-post-install.sh.tmpl" + - ID: "net-post-install.sh.tmpl" Name: "net-post-install.sh" Path: "{{.Machine.Path}}/post-install.sh" diff --git a/content/params/access-keys.yaml b/content/params/access-keys.yaml new file mode 100644 index 00000000..94837e13 --- /dev/null +++ b/content/params/access-keys.yaml @@ -0,0 +1,17 @@ +--- +Name: "access-keys" +Description: "A map of ssh public keys to install for the root user" +Documentation: | + This map is used to put ssh public keys in place for the root user. + + The key of the map is a arbritary name and the value is the ssh + public key for that name. + +Schema: + type: "object" + additionalProperties: + type: "string" +Meta: + icon: key + color: blue + title: RackN Content \ No newline at end of file diff --git a/content/params/access-ssh-root-mode.yaml b/content/params/access-ssh-root-mode.yaml new file mode 100644 index 00000000..598d142a --- /dev/null +++ b/content/params/access-ssh-root-mode.yaml @@ -0,0 +1,19 @@ +--- +Name: "access-ssh-root-mode" +Description: "Defines the root login policy" +Documentation: | + This string defines the login policy for the root user. + + Possible values are: + without-password - default + yes + no + forced-commands-only + +Schema: + type: "string" + +Meta: + icon: unlock + color: blue + title: RackN Content \ No newline at end of file diff --git a/content/params/change-stage.map.yaml b/content/params/change-stage.map.yaml new file mode 100644 index 00000000..542dd175 --- /dev/null +++ b/content/params/change-stage.map.yaml @@ -0,0 +1,17 @@ +--- +Name: "change-stage/map" +Description: "A map of current stage to next stage and reboot choices" +Documentation: | + This map is used to select the next stage based upon the current stage. + + The form is current stage as the key with the value being a string with a + colon seperated next stage and return action (success or reboot). + +Schema: + type: "object" + additionalProperties: + type: "string" +Meta: + icon: shuffle + color: blue + title: RackN Content \ No newline at end of file diff --git a/content/params/gohai-inventory.yaml b/content/params/gohai-inventory.yaml new file mode 100644 index 00000000..3744b56f --- /dev/null +++ b/content/params/gohai-inventory.yaml @@ -0,0 +1,7 @@ +--- +Name: gohai-inventory +Description: System inventory as reported by Gohai +Meta: + icon: search + color: blue + title: RackN Content diff --git a/content/params/kernel-console.yaml b/content/params/kernel-console.yaml new file mode 100644 index 00000000..3e47bba2 --- /dev/null +++ b/content/params/kernel-console.yaml @@ -0,0 +1,15 @@ +--- +Name: "kernel-console" +Description: "Defines the console string to use for boot environments" +Documentation: | + This string defines the console tty string for the kernel boot string. + + e.g. console=ttyS1,115200 + +Schema: + type: "string" + +Meta: + icon: desktop + color: blue + title: RackN Content \ No newline at end of file diff --git a/content/profiles/ce-root-access.yml b/content/profiles/root-access-example.yml similarity index 96% rename from content/profiles/ce-root-access.yml rename to content/profiles/root-access-example.yml index 8ed433ec..a3cb2724 100644 --- a/content/profiles/ce-root-access.yml +++ b/content/profiles/root-access-example.yml @@ -1,4 +1,4 @@ -Name: ce-root-access +Name: root-access-example Params: access-keys: greg: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDvqrpVfs9MXwjleLNPICcjAMviF3FJq85sMAe/4ejNDLMOcjDIFz4aQxrZx6sPlaqWADdy9XADaKgaYZwNssE9s6GNGJVORXl+vacLslwcrWo7aThzfKSlkn6wul3PcVjvIINQGiH/sUznLT8zUGR0hWX2Pds80iSxaQhIoFC8+DEVPSr5CIlliaCiYmwBB2FjBvR6ryltqxx3PIjJ4RwiP77DV6kdkG2khdY2XB7WLJptlgrg2U20TKG/9LrBqPFcM/m0BEmp01xN60A/O5Iw+vTXQoR3CX0mlNIzQIeAbtqau+uPkzd2TPzNOZebEvOnw1MxJPLjLqvxXRw54Bt9 galthaus@Gregs-MacBook-Pro.local diff --git a/content/stages/centos-7.4.1708.yml b/content/stages/centos-7.4.1708.yml new file mode 100644 index 00000000..2387d356 --- /dev/null +++ b/content/stages/centos-7.4.1708.yml @@ -0,0 +1,12 @@ +--- +Name: "centos-7.4.1708-install" +BootEnv: "centos-7.4.1708-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content diff --git a/content/stages/centos-7.yml b/content/stages/centos-7.yml new file mode 100644 index 00000000..007739ea --- /dev/null +++ b/content/stages/centos-7.yml @@ -0,0 +1,12 @@ +--- +Name: "centos-7-install" +BootEnv: "centos-7-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content diff --git a/content/stages/complete-nowait.yaml b/content/stages/complete-nowait.yaml new file mode 100644 index 00000000..023f85b2 --- /dev/null +++ b/content/stages/complete-nowait.yaml @@ -0,0 +1,8 @@ +--- +Name: "complete-nowait" +BootEnv: "local" +Meta: + icon: checkmark + color: green + title: RackN Content + diff --git a/content/stages/complete.yml b/content/stages/complete.yml new file mode 100644 index 00000000..106c58db --- /dev/null +++ b/content/stages/complete.yml @@ -0,0 +1,8 @@ +--- +Name: "complete" +BootEnv: "local" +RunnerWait: true +Meta: + icon: "check circle outline" + color: green + title: RackN Content diff --git a/content/stages/debian-8.yml b/content/stages/debian-8.yml new file mode 100644 index 00000000..0563ff5b --- /dev/null +++ b/content/stages/debian-8.yml @@ -0,0 +1,12 @@ +--- +Name: "debian-8-install" +BootEnv: "debian-8-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/content/stages/debian-9.yml b/content/stages/debian-9.yml new file mode 100644 index 00000000..0f1ed253 --- /dev/null +++ b/content/stages/debian-9.yml @@ -0,0 +1,12 @@ +--- +Name: "debian-9-install" +BootEnv: "debian-9-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content diff --git a/content/stages/discover.yaml b/content/stages/discover.yaml new file mode 100644 index 00000000..4a003fd5 --- /dev/null +++ b/content/stages/discover.yaml @@ -0,0 +1,16 @@ +--- +Name: "discover" +BootEnv: "sledgehammer" +RunnerWait: true +OptionalParams: + - "change-stage/map" + - "access-keys" + - "access-ssh-root-mode" +Tasks: + - "gohai" + - "ssh-access" + - "change-stage" +Meta: + icon: spinner + color: yellow + title: RackN Content diff --git a/content/stages/finish-install.yaml b/content/stages/finish-install.yaml new file mode 100644 index 00000000..eba66b50 --- /dev/null +++ b/content/stages/finish-install.yaml @@ -0,0 +1,10 @@ +--- +Name: "finish-install" +BootEnv: "local" +Tasks: + - change-stage +Meta: + icon: checkmark + color: yellow + title: RackN Content + diff --git a/content/stages/sledgehammer-wait.yaml b/content/stages/sledgehammer-wait.yaml new file mode 100644 index 00000000..903d8839 --- /dev/null +++ b/content/stages/sledgehammer-wait.yaml @@ -0,0 +1,9 @@ +--- +Name: "sledgehammer-wait" +Description: "Wait for more tasks in sledgehammer - useful for debugging" +BootEnv: "sledgehammer" +RunnerWait: true +Meta: + icon: hand paper + color: yellow + title: RackN Content diff --git a/content/stages/ssh-access.yaml b/content/stages/ssh-access.yaml new file mode 100644 index 00000000..ba56dbc6 --- /dev/null +++ b/content/stages/ssh-access.yaml @@ -0,0 +1,14 @@ +--- +Name: "ssh-access" +RunnerWait: true +OptionalParams: + - "change-stage/map" + - "access-keys" + - "access-ssh-root-mode" +Tasks: + - "ssh-access" + - "change-stage" +Meta: + icon: key + color: yellow + title: RackN Content diff --git a/content/stages/ubuntu-16.04.yml b/content/stages/ubuntu-16.04.yml new file mode 100644 index 00000000..560f1d79 --- /dev/null +++ b/content/stages/ubuntu-16.04.yml @@ -0,0 +1,12 @@ +--- +Name: "ubuntu-16.04-install" +BootEnv: "ubuntu-16.04-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/content/tasks/centos-drp-only-repos.yaml b/content/tasks/centos-drp-only-repos.yaml new file mode 100644 index 00000000..960818f7 --- /dev/null +++ b/content/tasks/centos-drp-only-repos.yaml @@ -0,0 +1,13 @@ +Description: A task to force the node to switch DRP hosted-only repos. +Name: centos-drp-only-repos +OptionalParams: + - local-repo +RequiredParams: null +Templates: + - ID: centos-drp-only-repos.sh.tmpl + Name: Force node to install from drp hosted repos + Path: "" +Meta: + icon: key + color: blue + title: RackN Content diff --git a/content/tasks/change-stage.yaml b/content/tasks/change-stage.yaml new file mode 100644 index 00000000..630697be --- /dev/null +++ b/content/tasks/change-stage.yaml @@ -0,0 +1,13 @@ +Description: A task to change stages +Name: change-stage +OptionalParams: null +RequiredParams: null +Templates: +- ID: change-stage.sh.tmpl + Name: Change stage + Path: "" +Meta: + icon: shuffle + color: blue + title: RackN Content + feature-flags: "sane-exit-codes" diff --git a/content/tasks/gohai.yaml b/content/tasks/gohai.yaml new file mode 100644 index 00000000..90dc3753 --- /dev/null +++ b/content/tasks/gohai.yaml @@ -0,0 +1,13 @@ +--- +Name: gohai +Description: Get basic system inventory using Gohai +Templates: + - Name: gohai + Contents: | + #!/usr/bin/env bash + drpcli machines set {{.Machine.UUID}} set gohai-inventory to "$(gohai)" +Meta: + icon: search + color: blue + title: RackN Content + feature-flags: "sane-exit-codes" diff --git a/content/tasks/set-hostname.yaml b/content/tasks/set-hostname.yaml new file mode 100644 index 00000000..3a1daed0 --- /dev/null +++ b/content/tasks/set-hostname.yaml @@ -0,0 +1,12 @@ +Description: A task to set the hostname +Name: set-hostname +OptionalParams: null +RequiredParams: null +Templates: + - ID: set-hostname.sh.tmpl + Name: Set the hostname on the machine + Path: "" +Meta: + icon: key + color: blue + title: RackN Content diff --git a/content/tasks/ssh-access.yaml b/content/tasks/ssh-access.yaml new file mode 100644 index 00000000..2a96772e --- /dev/null +++ b/content/tasks/ssh-access.yaml @@ -0,0 +1,13 @@ +Description: A task to put root ssh keys in place +Name: ssh-access +OptionalParams: + - access-keys +RequiredParams: null +Templates: + - ID: access-keys.sh.tmpl + Name: Put access keys in place for root user + Path: "" +Meta: + icon: key + color: blue + title: RackN Content diff --git a/content/tasks/ubuntu-drp-only-repos.yaml b/content/tasks/ubuntu-drp-only-repos.yaml new file mode 100644 index 00000000..9ca5627a --- /dev/null +++ b/content/tasks/ubuntu-drp-only-repos.yaml @@ -0,0 +1,13 @@ +Description: A task to force the node to switch DRP hosted-only repos. +Name: ubuntu-drp-only-repos +OptionalParams: + - local-repo +RequiredParams: null +Templates: + - ID: ubuntu-drp-only-repos.sh.tmpl + Name: Force node to install from drp hosted repos + Path: "" +Meta: + icon: key + color: blue + title: RackN Content diff --git a/content/templates/ce-root-remote-access.tmpl b/content/templates/access-keys.sh.tmpl similarity index 60% rename from content/templates/ce-root-remote-access.tmpl rename to content/templates/access-keys.sh.tmpl index c924154a..fdf244fe 100644 --- a/content/templates/ce-root-remote-access.tmpl +++ b/content/templates/access-keys.sh.tmpl @@ -1,3 +1,4 @@ +#!/bin/bash # # This template populates the root's authorized keys file # and makes sure that the sshd config for PermitRootLogin is populated. @@ -19,15 +20,34 @@ # access-keys - empty # access-ssh-root-mode - defaults to "without-password" if unspecified # + {{if .ParamExists "access-keys"}} +echo "Putting ssh access keys for root in place" mkdir -p /root/.ssh -cat >/root/.ssh/authorized_keys <>/root/.ssh/authorized_keys <> /etc/ssh/sshd_config echo "AcceptEnv http_proxy https_proxy no_proxy" >> /etc/ssh/sshd_config -{{end}} + +# Restart sshd but os badness. +. /etc/os-release +# Ignore error because we may run in a place that doesn't have ssh installed +if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]] ; then + echo "Restarting ssh" + service ssh restart || true +else + echo "Restarting sshd" + service sshd restart || true +fi + +echo "Finished updating access keys successfully" +exit 0 diff --git a/content/templates/ce-update-drp-local.tmpl b/content/templates/ce-update-drp-local.tmpl deleted file mode 100644 index 64a69542..00000000 --- a/content/templates/ce-update-drp-local.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -# -# This template populates updates the machine object's -# BootEnv in DRP to 'local' or some other bootenv. -# -# Runs as part of a shell script for kickstart or net-post-install -# The template does is always on, but can be modified -# -# Required Parameters: -# Optional Parameters: next-boot-env -# -# Parameter YAML format: -# -# next-boot-env: local -# -# Defaults: -# next-boot-env - defaults to local if unspecified -# -(cd /bin; curl -s -f -L -o drpcli "{{.ProvisionerURL}}/files/drpcli.amd64.linux"; chmod 755 drpcli) -export RS_ENDPOINT="{{.ApiURL}}" -# This will contain a token appropriate for the path being -# used below. Either a create or update/show token -export RS_TOKEN="{{.GenerateToken}}" -drpcli machines update "{{.Machine.UUID}}" '{"BootEnv": "{{if .ParamExists "next-boot-env"}}{{.Param "next-boot-env"}}{{else}}local{{end}}"}' - diff --git a/content/templates/ce-centos-7.ks.tmpl b/content/templates/centos-7.ks.tmpl similarity index 89% rename from content/templates/ce-centos-7.ks.tmpl rename to content/templates/centos-7.ks.tmpl index 8460b738..4e984dbb 100644 --- a/content/templates/ce-centos-7.ks.tmpl +++ b/content/templates/centos-7.ks.tmpl @@ -3,7 +3,7 @@ install url --url {{.Env.InstallUrl}} # Add support for our local proxy. -repo --name="CentOS" --baseurl={{.Env.InstallUrl}} --cost=100 +repo --name="CentOS" --baseurl={{.Env.InstallUrl}} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0 "url"}}"{{end}} --cost=100 # key --skip # Disable geolocation for language and timezone # Currently broken by https://bugzilla.redhat.com/show_bug.cgi?id=1111717 @@ -47,9 +47,8 @@ exec > /root/post-install.log 2>&1 set -x export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ' -{{template "ce-set-hostname.tmpl" .}} -{{template "ce-root-remote-access.tmpl" .}} -{{template "ce-update-drp-local.tmpl" .}} +RUNNER_WAIT=false +{{template "runner.tmpl" .}} sync %end diff --git a/content/templates/centos-drp-only-repos.sh.tmpl b/content/templates/centos-drp-only-repos.sh.tmpl new file mode 100644 index 00000000..666e169b --- /dev/null +++ b/content/templates/centos-drp-only-repos.sh.tmpl @@ -0,0 +1,34 @@ +#!/bin/bash +{{ if .ParamExists "local_repo" }} +{{ if eq (.Param "local_repo") true }} +# +# This template forces a yum-based install +# to use only the local DRP provided repo. +# +# Runs as part of a shell script for kickstart +# The template does is only functional if local_repo is true. +# +# Required Parameters: local_repo +# Optional Parameters: +# +# Parameter YAML format: +# +# local_repo: true +# +# Defaults: +# local_repo - Function is enabled if and only local_repo is true +# +(cd /etc/yum.repos.d; rm -f * || :) + +# Use the install repo from the provisioner for local package installation +cat >/etc/yum.repos.d/00-rebar-base.repo </dev/null; then + repocontents+=('deb {{.Env.InstallUrl}} stable restricted') +fi + +printf "%s\n" "${repocontents[@]}" > "$repofile" +apt-get -y --force-yes update +{{ end }} +{{ end }} diff --git a/contrib/._Version.meta b/contrib/._Version.meta index 5d210523..e0886980 100644 --- a/contrib/._Version.meta +++ b/contrib/._Version.meta @@ -1 +1 @@ -v1.0.0-tip-galthaus-dev-16-b0c42db46653826e33c02b5697bf80841c2b5060 \ No newline at end of file +v1.0.0-tip-galthaus-dev-18-01a178d81d32fef0ab52fd9d2fcf222bfda87aea \ No newline at end of file diff --git a/contrib/bootenvs/centos-6.8.yml b/contrib/bootenvs/centos-6.8.yml new file mode 100644 index 00000000..2f34dc7d --- /dev/null +++ b/contrib/bootenvs/centos-6.8.yml @@ -0,0 +1,31 @@ +--- +Name: "centos-6.8-install" +OS: + Name: "centos-6.8" + IsoFile: "CentOS-6.8-x86_64-bin-DVD1.iso" + IsoSha256: "1dda55622614a8b43b448a72f87d6cb7f79de1eff49ee8c5881a7d9db28d4e35" + IsoUrl: "http://mirrors.kernel.org/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-bin-DVD1.iso" +Kernel: "images/pxeboot/vmlinuz" +Initrds: + - "images/pxeboot/initrd.img" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +RequiredParams: +OptionalParams: + - "ntp-servers" + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "access-keys" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "centos-6.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/contrib/bootenvs/centos-7.3.1611.yml b/contrib/bootenvs/centos-7.3.1611.yml new file mode 100644 index 00000000..679ac7b6 --- /dev/null +++ b/contrib/bootenvs/centos-7.3.1611.yml @@ -0,0 +1,31 @@ +--- +Name: "centos-7.3.1611-install" +OS: + Name: "centos-7.3.1611" + IsoFile: "CentOS-7-x86_64-Minimal-1611.iso" + IsoSha256: "27bd866242ee058b7a5754e83d8ee8403e216b93d130d800852a96f41c34d86a" + IsoUrl: "http://mirrors.kernel.org/centos/7.3.1611/isos/x86_64/CentOS-7-x86_64-Minimal-1611.iso" +Kernel: "images/pxeboot/vmlinuz" +Initrds: + - "images/pxeboot/initrd.img" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} inst.geoloc=0 -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +RequiredParams: +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "access-keys" + - "kernel-console" + - "proxy-servers" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "centos-7.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/contrib/bootenvs/scientificlinux-6.8.yml b/contrib/bootenvs/scientificlinux-6.8.yml new file mode 100644 index 00000000..fbf0c537 --- /dev/null +++ b/contrib/bootenvs/scientificlinux-6.8.yml @@ -0,0 +1,31 @@ +--- +Name: "scientificlinux-6.8-install" +OS: + Name: "scientificlinux-6.8" + IsoFile: "SL-68-x86_64-2016-06-29-DVD-DL.iso" + IsoSha256: "ada95b0e920612a5a9c56e268515a9965663377407a7897167be7a2efdade804" + IsoUrl: "http://ftp1.scientificlinux.org/linux/scientific/6.8/x86_64/iso/SL-68-x86_64-2016-06-29-DVD-DL.iso" +Kernel: "images/pxeboot/vmlinuz" +Initrds: + - "images/pxeboot/initrd.img" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +RequiredParams: +OptionalParams: + - "ntp-servers" + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "access-keys" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "centos-6.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/contrib/bootenvs/ubuntu-14.04.yml b/contrib/bootenvs/ubuntu-14.04.yml new file mode 100644 index 00000000..19b197ea --- /dev/null +++ b/contrib/bootenvs/ubuntu-14.04.yml @@ -0,0 +1,41 @@ +--- +Name: "ubuntu-14.04-install" +OS: + Name: "ubuntu-14.04" + Version: "14.04" + Family: "ubuntu" + IsoFile: "ubuntu-14.04.5-server-amd64.iso" + IsoSha256: "dde07d37647a1d2d9247e33f14e91acb10445a97578384896b4e1d985f754cc1" + IsoUrl: "http://mirrors.kernel.org/ubuntu-releases/trusty/ubuntu-14.04.5-server-amd64.iso" +Kernel: "install/netboot/ubuntu-installer/amd64/linux" +Initrds: + - "install/netboot/ubuntu-installer/amd64/initrd.gz" +BootParams: "debian-installer/locale=en_US.utf8 console-setup/layoutcode=us keyboard-configuration/layoutcode=us + netcfg/dhcp_timeout=120 netcfg/choose_interface=auto url={{.Machine.Url}}/seed netcfg/get_hostname={{.Machine.Name}} + root=/dev/ram rw quiet {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }} -- + {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +RequiredParams: +OptionalParams: + - "dns-domain" + - "ntp-servers" + - "operating-system-disk" + - "provisioner-default-password-hash" + - "provisioner-default-user" + - "proxy-servers" + - "access-keys" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "net-seed.tmpl" + Name: "seed" + Path: "{{.Machine.Path}}/seed" + - ID: "net-post-install.sh.tmpl" + Name: "net-post-install.sh" + Path: "{{.Machine.Path}}/post-install.sh" diff --git a/contrib/stages/centos-6.8.yml b/contrib/stages/centos-6.8.yml new file mode 100644 index 00000000..a4c04d4e --- /dev/null +++ b/contrib/stages/centos-6.8.yml @@ -0,0 +1,12 @@ +--- +Name: "centos-6.8-install" +BootEnv: "centos-6.8-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/contrib/stages/centos-7.3.1611.yml b/contrib/stages/centos-7.3.1611.yml new file mode 100644 index 00000000..464b9d12 --- /dev/null +++ b/contrib/stages/centos-7.3.1611.yml @@ -0,0 +1,12 @@ +--- +Name: "centos-7.3.1611-install" +BootEnv: "centos-7.3.1611-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/contrib/stages/scientificlinux-6.8.yml b/contrib/stages/scientificlinux-6.8.yml new file mode 100644 index 00000000..2ca22a9a --- /dev/null +++ b/contrib/stages/scientificlinux-6.8.yml @@ -0,0 +1,12 @@ +--- +Name: "scientificlinux-6.8-install" +BootEnv: "scientificlinux-6.8-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/contrib/stages/ubuntu-14.04.yml b/contrib/stages/ubuntu-14.04.yml new file mode 100644 index 00000000..20a6fbc5 --- /dev/null +++ b/contrib/stages/ubuntu-14.04.yml @@ -0,0 +1,12 @@ +--- +Name: "ubuntu-14.04-install" +BootEnv: "ubuntu-14.04-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content \ No newline at end of file diff --git a/contrib/templates/centos-6.ks.tmpl b/contrib/templates/centos-6.ks.tmpl new file mode 100644 index 00000000..2c80708d --- /dev/null +++ b/contrib/templates/centos-6.ks.tmpl @@ -0,0 +1,57 @@ +# DigitalRebar Provision Centos-6 (and related distros) kickstart +install +url --url {{ .Env.InstallUrl }} +# Add support for our local proxy. +repo --name="CentOS" --baseurl={{ .Env.InstallUrl }} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0 "url"}}"{{end}} --cost=100 +key --skip +lang en_US.UTF-8 +keyboard us +# rebar +rootpw --iscrypted {{if .ParamExists "provisioner-default-password-hash"}}{{ .Param "provisioner-default-password-hash" }}{{else}}$6$rebar$HBaBj/uDmsQMEw4Si6eja9Yba3rhB73Na36hbrp9KxDHm6s5veeWyXlsUkoxRACtP47978iiidziRdsYUC7gC/{{end}} +firewall --disabled +authconfig --enableshadow --enablemd5 +selinux --disabled +timezone --utc UTC +bootloader --location=mbr {{if .ParamExists "operating-system-disk"}}--driveorder={{ .Param "operating-system-disk" }}{{end}} --append="rhgb quiet" +zerombr +{{if .ParamExists "operating-system-disk"}}ignoredisk --only-use={{ .Param "operating-system-disk" }}{{end}} +clearpart --all {{if .ParamExists "operating-system-disk"}}--drives={{ .Param "operating-system-disk" }}{{end}} +part /boot --fstype ext4 --size=512 {{if .ParamExists "operating-system-disk"}}--ondisk={{ .Param "operating-system-disk" }}{{end}} +part /boot/efi --fstype vfat --size=512 {{if .ParamExists "operating-system-disk"}}--ondisk={{ .Param "operating-system-disk" }}{{end}} +part swap --recommended +part pv.6 --size=1 --grow {{if .ParamExists "operating-system-disk"}}--ondisk={{ .Param "operating-system-disk" }}{{end}} +volgroup {{ .Machine.ShortName }} --pesize=32768 pv.6 +logvol / --fstype ext4 --name=lv_root --vgname={{ .Machine.ShortName }} --size=1 --grow --maxsize=10240 +text +reboot + +%packages +@base +@core +vim-enhanced +keyutils +trousers +fipscheck +device-mapper-multipath +OpenIPMI +OpenIPMI-tools +emacs-nox +openssh +curl.x86_64 +ntp +ntpdate +tcpdump +efibootmgr +%post + +exec > /root/post-install.log 2>&1 +set -x +export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ' + +{{ template "centos-drp-only-repos.tmpl" . }} + +RUNNER_WAIT=false +{{ template "runner.tmpl" . }} + +sync +%end From 7c2ea0d5eefeace6e1dc024ae92e4fb53b1e6ea4 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Thu, 26 Oct 2017 15:35:55 -0500 Subject: [PATCH 04/25] Remove version for git and fix centos6 to match c7 runner --- .gitignore | 2 ++ content/._Version.meta | 1 - contrib/._Version.meta | 1 - contrib/templates/centos-6.ks.tmpl | 3 +-- 4 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 content/._Version.meta delete mode 100644 contrib/._Version.meta diff --git a/.gitignore b/.gitignore index e2714eb4..d5a608a7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ drp-community-content.sha256 drp-community-content.yaml drp-community-contrib.sha256 drp-community-contrib.yaml +content/._Version.meta +contrib/._Version.meta key1* key2* e-info.tgz diff --git a/content/._Version.meta b/content/._Version.meta deleted file mode 100644 index e0886980..00000000 --- a/content/._Version.meta +++ /dev/null @@ -1 +0,0 @@ -v1.0.0-tip-galthaus-dev-18-01a178d81d32fef0ab52fd9d2fcf222bfda87aea \ No newline at end of file diff --git a/contrib/._Version.meta b/contrib/._Version.meta deleted file mode 100644 index e0886980..00000000 --- a/contrib/._Version.meta +++ /dev/null @@ -1 +0,0 @@ -v1.0.0-tip-galthaus-dev-18-01a178d81d32fef0ab52fd9d2fcf222bfda87aea \ No newline at end of file diff --git a/contrib/templates/centos-6.ks.tmpl b/contrib/templates/centos-6.ks.tmpl index 2c80708d..ef69b8b4 100644 --- a/contrib/templates/centos-6.ks.tmpl +++ b/contrib/templates/centos-6.ks.tmpl @@ -1,4 +1,5 @@ # DigitalRebar Provision Centos-6 (and related distros) kickstart + install url --url {{ .Env.InstallUrl }} # Add support for our local proxy. @@ -48,8 +49,6 @@ exec > /root/post-install.log 2>&1 set -x export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ' -{{ template "centos-drp-only-repos.tmpl" . }} - RUNNER_WAIT=false {{ template "runner.tmpl" . }} From a43518aa26998eb9ad8ce7d9828913955bd7d623 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Thu, 26 Oct 2017 15:41:44 -0500 Subject: [PATCH 05/25] Update stages to use tasks --- content/stages/centos-7.4.1708.yml | 3 +++ content/stages/centos-7.yml | 3 +++ content/stages/debian-8.yml | 4 +++- content/stages/debian-9.yml | 2 ++ content/stages/finish-install.yaml | 2 +- content/stages/ubuntu-16.04.yml | 4 +++- contrib/stages/centos-6.8.yml | 5 ++++- contrib/stages/centos-7.3.1611.yml | 5 ++++- contrib/stages/scientificlinux-6.8.yml | 5 ++++- contrib/stages/ubuntu-14.04.yml | 4 +++- 10 files changed, 30 insertions(+), 7 deletions(-) diff --git a/content/stages/centos-7.4.1708.yml b/content/stages/centos-7.4.1708.yml index 2387d356..d25d87c9 100644 --- a/content/stages/centos-7.4.1708.yml +++ b/content/stages/centos-7.4.1708.yml @@ -5,6 +5,9 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download diff --git a/content/stages/centos-7.yml b/content/stages/centos-7.yml index 007739ea..e84eb843 100644 --- a/content/stages/centos-7.yml +++ b/content/stages/centos-7.yml @@ -5,6 +5,9 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download diff --git a/content/stages/debian-8.yml b/content/stages/debian-8.yml index 0563ff5b..71ae341c 100644 --- a/content/stages/debian-8.yml +++ b/content/stages/debian-8.yml @@ -5,8 +5,10 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content diff --git a/content/stages/debian-9.yml b/content/stages/debian-9.yml index 0f1ed253..3392386e 100644 --- a/content/stages/debian-9.yml +++ b/content/stages/debian-9.yml @@ -5,6 +5,8 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download diff --git a/content/stages/finish-install.yaml b/content/stages/finish-install.yaml index eba66b50..2042763f 100644 --- a/content/stages/finish-install.yaml +++ b/content/stages/finish-install.yaml @@ -2,7 +2,7 @@ Name: "finish-install" BootEnv: "local" Tasks: - - change-stage + - "change-stage" Meta: icon: checkmark color: yellow diff --git a/content/stages/ubuntu-16.04.yml b/content/stages/ubuntu-16.04.yml index 560f1d79..56722d74 100644 --- a/content/stages/ubuntu-16.04.yml +++ b/content/stages/ubuntu-16.04.yml @@ -5,8 +5,10 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content diff --git a/contrib/stages/centos-6.8.yml b/contrib/stages/centos-6.8.yml index a4c04d4e..9dce5bf9 100644 --- a/contrib/stages/centos-6.8.yml +++ b/contrib/stages/centos-6.8.yml @@ -5,8 +5,11 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content diff --git a/contrib/stages/centos-7.3.1611.yml b/contrib/stages/centos-7.3.1611.yml index 464b9d12..373fb319 100644 --- a/contrib/stages/centos-7.3.1611.yml +++ b/contrib/stages/centos-7.3.1611.yml @@ -5,8 +5,11 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content diff --git a/contrib/stages/scientificlinux-6.8.yml b/contrib/stages/scientificlinux-6.8.yml index 2ca22a9a..1f78d3c7 100644 --- a/contrib/stages/scientificlinux-6.8.yml +++ b/contrib/stages/scientificlinux-6.8.yml @@ -5,8 +5,11 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content diff --git a/contrib/stages/ubuntu-14.04.yml b/contrib/stages/ubuntu-14.04.yml index 20a6fbc5..bcc3fc36 100644 --- a/contrib/stages/ubuntu-14.04.yml +++ b/contrib/stages/ubuntu-14.04.yml @@ -5,8 +5,10 @@ RunnerWait: true OptionalParams: - "change-stage/map" Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" - "change-stage" Meta: icon: download color: yellow - title: RackN Content \ No newline at end of file + title: RackN Content From f9b7dbac39c740183320ffe09cb26183545052f0 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 09:57:13 -0500 Subject: [PATCH 06/25] Fix git version issues --- .travis.yml | 2 ++ tools/version.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9edfdf59..0ae07816 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ branches: sudo: false go: - 1.9 +git: + depth: 500 addons: apt: packages: diff --git a/tools/version.sh b/tools/version.sh index c90a9b86..b140a4b1 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -14,7 +14,7 @@ fi if [[ $BASE == tip || $TAG == tip ]] ; then Extra="-tip" - TAG=$(git describe --tags --abbrev=1000 tip^2 --always) + TAG=$(git describe --tags --abbrev=1000 tip^2) if [[ $TAG =~ $tag_re ]]; then BASE="${BASH_REMATCH[1]}" if [[ $AHEAD ]] ; then From 78fe162a73040b4577d7fc87c10cf1d88d28357e Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 11:48:50 -0500 Subject: [PATCH 07/25] Update to centos 6.9 --- .../bootenvs/{centos-6.8.yml => centos-6.9.yml} | 10 +++++----- contrib/stages/{centos-6.8.yml => centos-6.9.yml} | 4 ++-- contrib/stages/centos-6.yml | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) rename contrib/bootenvs/{centos-6.8.yml => centos-6.9.yml} (74%) rename contrib/stages/{centos-6.8.yml => centos-6.9.yml} (78%) create mode 100644 contrib/stages/centos-6.yml diff --git a/contrib/bootenvs/centos-6.8.yml b/contrib/bootenvs/centos-6.9.yml similarity index 74% rename from contrib/bootenvs/centos-6.8.yml rename to contrib/bootenvs/centos-6.9.yml index 2f34dc7d..90e02d7f 100644 --- a/contrib/bootenvs/centos-6.8.yml +++ b/contrib/bootenvs/centos-6.9.yml @@ -1,10 +1,10 @@ --- -Name: "centos-6.8-install" +Name: "centos-6.9-install" OS: - Name: "centos-6.8" - IsoFile: "CentOS-6.8-x86_64-bin-DVD1.iso" - IsoSha256: "1dda55622614a8b43b448a72f87d6cb7f79de1eff49ee8c5881a7d9db28d4e35" - IsoUrl: "http://mirrors.kernel.org/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-bin-DVD1.iso" + Name: "centos-6.9" + IsoFile: "CentOS-6.9-x86_64-minimal.iso" + IsoSha256: "422af57b493b8af49d485885a730c5a1d955f803fac85aa51311c393168b9080" + IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-minimal.iso" Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" diff --git a/contrib/stages/centos-6.8.yml b/contrib/stages/centos-6.9.yml similarity index 78% rename from contrib/stages/centos-6.8.yml rename to contrib/stages/centos-6.9.yml index 9dce5bf9..e6e00adc 100644 --- a/contrib/stages/centos-6.8.yml +++ b/contrib/stages/centos-6.9.yml @@ -1,6 +1,6 @@ --- -Name: "centos-6.8-install" -BootEnv: "centos-6.8-install" +Name: "centos-6.9-install" +BootEnv: "centos-6.9-install" RunnerWait: true OptionalParams: - "change-stage/map" diff --git a/contrib/stages/centos-6.yml b/contrib/stages/centos-6.yml new file mode 100644 index 00000000..3c029523 --- /dev/null +++ b/contrib/stages/centos-6.yml @@ -0,0 +1,15 @@ +--- +Name: "centos-6-install" +BootEnv: "centos-6.9-install" +RunnerWait: true +OptionalParams: + - "change-stage/map" +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: download + color: yellow + title: RackN Content From 939487d10b152ba42409bd41e5acb247ae5aae65 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 11:52:45 -0500 Subject: [PATCH 08/25] Make six work like 7 --- contrib/bootenvs/centos-6.yml | 31 +++++++++++++++++++++++++++++++ contrib/stages/centos-6.yml | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 contrib/bootenvs/centos-6.yml diff --git a/contrib/bootenvs/centos-6.yml b/contrib/bootenvs/centos-6.yml new file mode 100644 index 00000000..5402aed1 --- /dev/null +++ b/contrib/bootenvs/centos-6.yml @@ -0,0 +1,31 @@ +--- +Name: "centos-6-install" +OS: + Name: "centos-6" + IsoFile: "CentOS-6.9-x86_64-minimal.iso" + IsoSha256: "422af57b493b8af49d485885a730c5a1d955f803fac85aa51311c393168b9080" + IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-minimal.iso" +Kernel: "images/pxeboot/vmlinuz" +Initrds: + - "images/pxeboot/initrd.img" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +RequiredParams: +OptionalParams: + - "ntp-servers" + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "access-keys" +Templates: + - ID: "default-pxelinux.tmpl" + Name: "pxelinux" + Path: "pxelinux.cfg/{{.Machine.HexAddress}}" + - ID: "default-elilo.tmpl" + Name: "elilo" + Path: "{{.Machine.HexAddress}}.conf" + - ID: "default-ipxe.tmpl" + Name: "ipxe" + Path: "{{.Machine.Address}}.ipxe" + - ID: "centos-6.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/contrib/stages/centos-6.yml b/contrib/stages/centos-6.yml index 3c029523..ced95f18 100644 --- a/contrib/stages/centos-6.yml +++ b/contrib/stages/centos-6.yml @@ -1,6 +1,6 @@ --- Name: "centos-6-install" -BootEnv: "centos-6.9-install" +BootEnv: "centos-6-install" RunnerWait: true OptionalParams: - "change-stage/map" From ebcbe142e7d5b55a87372c7514b5dc804b1f66a1 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 13:15:48 -0500 Subject: [PATCH 09/25] Add @wdennis change --- content/templates/access-keys.sh.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/templates/access-keys.sh.tmpl b/content/templates/access-keys.sh.tmpl index fdf244fe..eaca8f85 100644 --- a/content/templates/access-keys.sh.tmpl +++ b/content/templates/access-keys.sh.tmpl @@ -35,8 +35,7 @@ chmod 600 /root/.ssh/authorized_keys {{end}} echo "Updating SSHD default values" -echo "PermitRootLogin {{if .ParamExists "access-ssh-root-mode"}}{{.Param "access-ssh-root-mode"}}{{else}}without-password{{end}}" >> /etc/ssh/sshd_config -echo "AcceptEnv http_proxy https_proxy no_proxy" >> /etc/ssh/sshd_config +sed --in-place -r -e '/^#?PermitRootLogin/ s/^#//' -e '/^#?PermitRootLogin/ s/prohibit-password/{{if .ParamExists "access-ssh-root-mode"}}{{.Param "access-ssh-root-mode"}}{{else}}without-password{{end}}/' /etc/ssh/sshd_config # Restart sshd but os badness. . /etc/os-release From e81c06e245941eec4e3e372bcf5cc9104d181926 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 14:11:11 -0500 Subject: [PATCH 10/25] Use the full dvd1 for centos69 --- contrib/bootenvs/centos-6.9.yml | 6 +++--- contrib/bootenvs/centos-6.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/bootenvs/centos-6.9.yml b/contrib/bootenvs/centos-6.9.yml index 90e02d7f..c2a33c65 100644 --- a/contrib/bootenvs/centos-6.9.yml +++ b/contrib/bootenvs/centos-6.9.yml @@ -2,9 +2,9 @@ Name: "centos-6.9-install" OS: Name: "centos-6.9" - IsoFile: "CentOS-6.9-x86_64-minimal.iso" - IsoSha256: "422af57b493b8af49d485885a730c5a1d955f803fac85aa51311c393168b9080" - IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-minimal.iso" + IsoFile: "CentOS-6.9-x86_64-bin-DVD1.iso" + IsoSha256: "d27cf37a40509c17ad70f37bc743f038c1feba00476fe6b69682aa424c399ea6" + IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-bin-DVD1.iso" Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" diff --git a/contrib/bootenvs/centos-6.yml b/contrib/bootenvs/centos-6.yml index 5402aed1..a9dbca9b 100644 --- a/contrib/bootenvs/centos-6.yml +++ b/contrib/bootenvs/centos-6.yml @@ -2,9 +2,9 @@ Name: "centos-6-install" OS: Name: "centos-6" - IsoFile: "CentOS-6.9-x86_64-minimal.iso" - IsoSha256: "422af57b493b8af49d485885a730c5a1d955f803fac85aa51311c393168b9080" - IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-minimal.iso" + IsoFile: "CentOS-6.9-x86_64-bin-DVD1.iso" + IsoSha256: "d27cf37a40509c17ad70f37bc743f038c1feba00476fe6b69682aa424c399ea6" + IsoUrl: "http://mirrors.kernel.org/centos/6.9/isos/x86_64/CentOS-6.9-x86_64-bin-DVD1.iso" Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" From 7eb080d61d541a74f5e6f2060b0a100984847b91 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 14:56:54 -0500 Subject: [PATCH 11/25] debian-9 doesn-t have a security space yet. --- content/templates/net-seed.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index 7515236e..b9652ca1 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -28,7 +28,9 @@ d-i mirror/country string manual d-i mirror/protocol string http d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian +{{if (eq "debian-8" .Env.OS.Name) -}} d-i apt-setup/security_host string security.debian.org/debian-security +{{end -}} {{else -}} {{if .ParamExists "local-repo" -}} {{if eq (.Param "local-repo") true}} From 85271d590790cf9059e6dc56971d23f41b006e37 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Fri, 27 Oct 2017 15:25:43 -0500 Subject: [PATCH 12/25] Fix kernel_console to kernel-console --- contrib/bootenvs/centos-6.9.yml | 2 +- contrib/bootenvs/centos-6.yml | 2 +- contrib/bootenvs/scientificlinux-6.8.yml | 2 +- contrib/bootenvs/ubuntu-14.04.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/bootenvs/centos-6.9.yml b/contrib/bootenvs/centos-6.9.yml index c2a33c65..4c08a72a 100644 --- a/contrib/bootenvs/centos-6.9.yml +++ b/contrib/bootenvs/centos-6.9.yml @@ -8,7 +8,7 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" RequiredParams: OptionalParams: - "ntp-servers" diff --git a/contrib/bootenvs/centos-6.yml b/contrib/bootenvs/centos-6.yml index a9dbca9b..9d4981ef 100644 --- a/contrib/bootenvs/centos-6.yml +++ b/contrib/bootenvs/centos-6.yml @@ -8,7 +8,7 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" RequiredParams: OptionalParams: - "ntp-servers" diff --git a/contrib/bootenvs/scientificlinux-6.8.yml b/contrib/bootenvs/scientificlinux-6.8.yml index fbf0c537..6edc1f18 100644 --- a/contrib/bootenvs/scientificlinux-6.8.yml +++ b/contrib/bootenvs/scientificlinux-6.8.yml @@ -8,7 +8,7 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" +BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" RequiredParams: OptionalParams: - "ntp-servers" diff --git a/contrib/bootenvs/ubuntu-14.04.yml b/contrib/bootenvs/ubuntu-14.04.yml index 19b197ea..aa61fe41 100644 --- a/contrib/bootenvs/ubuntu-14.04.yml +++ b/contrib/bootenvs/ubuntu-14.04.yml @@ -12,8 +12,8 @@ Initrds: - "install/netboot/ubuntu-installer/amd64/initrd.gz" BootParams: "debian-installer/locale=en_US.utf8 console-setup/layoutcode=us keyboard-configuration/layoutcode=us netcfg/dhcp_timeout=120 netcfg/choose_interface=auto url={{.Machine.Url}}/seed netcfg/get_hostname={{.Machine.Name}} - root=/dev/ram rw quiet {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }} -- - {{ if .ParamExists \"kernel_console\"}}{{.Param \"kernel_console\" }}{{ end }}" + root=/dev/ram rw quiet {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }} -- + {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" RequiredParams: OptionalParams: - "dns-domain" From 6a3b75c89dfdc8f30889ae49db5b5bb21479396e Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Mon, 30 Oct 2017 11:40:47 -0500 Subject: [PATCH 13/25] Fix source references Fix some variable usage. Clean-up files and add descriptions and documentation. Add Parameters for things. --- content/bootenvs/centos-7.4.1708.yml | 11 +++++-- content/bootenvs/centos-7.yml | 11 +++++-- content/bootenvs/debian-8.yml | 5 ++- content/bootenvs/debian-9.yml | 6 +++- content/bootenvs/discovery.yml | 18 ++++++++-- content/bootenvs/sledgehammer.yml | 17 ++++++++-- content/bootenvs/ubuntu-16.04.yml | 28 ++++++++++++---- content/params/access-keys.yaml | 6 ++-- content/params/access-ssh-root-mode.yaml | 6 ++-- content/params/change-stage.map.yaml | 6 ++-- content/params/dns-domain.yaml | 14 ++++++++ content/params/gohai-inventory.yaml | 14 +++++--- content/params/kernel-console.yaml | 6 ++-- content/params/local-repo.yaml | 14 ++++++++ content/params/ntp-servers.yaml | 16 +++++++++ content/params/operating-system-disk.yaml | 17 ++++++++++ content/params/part-scheme.yaml | 20 +++++++++++ .../params/provisioner-default-fullname.yaml | 13 ++++++++ .../provisioner-default-password-hash.yaml | 22 +++++++++++++ content/params/provisioner-default-uid.yaml | 15 +++++++++ content/params/provisioner-default-user.yaml | 13 ++++++++ content/params/proxy-servers.yaml | 17 ++++++++++ content/profiles/root-access-example.yml | 3 +- content/stages/centos-7.4.1708.yml | 9 +++-- content/stages/centos-7.yml | 9 +++-- content/stages/complete-nowait.yaml | 8 ++--- content/stages/complete.yml | 5 +-- content/stages/debian-8.yml | 9 +++-- content/stages/debian-9.yml | 9 +++-- content/stages/discover.yaml | 11 +++---- content/stages/finish-install.yaml | 8 ++--- content/stages/sledgehammer-wait.yaml | 6 ++-- content/stages/ssh-access.yaml | 11 +++---- content/stages/ubuntu-16.04.yml | 9 +++-- content/tasks/centos-drp-only-repos.yaml | 18 +++++----- content/tasks/change-stage.yaml | 19 ++++++----- content/tasks/gohai.yaml | 12 +++---- content/tasks/set-hostname.yaml | 17 +++++----- content/tasks/ssh-access.yaml | 19 ++++++----- content/tasks/ubuntu-drp-only-repos.yaml | 18 +++++----- content/templates/access-keys.sh.tmpl | 2 +- content/templates/centos-7.ks.tmpl | 2 +- .../templates/centos-drp-only-repos.sh.tmpl | 12 +++---- content/templates/net-seed.tmpl | 8 ++--- contrib/bootenvs/centos-6.9.yml | 12 ++++--- contrib/bootenvs/centos-6.yml | 12 ++++--- contrib/bootenvs/centos-7.3.1611.yml | 13 +++++--- contrib/bootenvs/scientificlinux-6.8.yml | 12 ++++--- contrib/bootenvs/ubuntu-14.04.yml | 33 ++++++++++++++----- contrib/stages/centos-6.9.yml | 9 +++-- contrib/stages/centos-6.yml | 9 +++-- contrib/stages/centos-7.3.1611.yml | 9 +++-- contrib/stages/scientificlinux-6.8.yml | 9 +++-- contrib/stages/ubuntu-14.04.yml | 9 +++-- contrib/templates/centos-6.ks.tmpl | 2 +- 55 files changed, 447 insertions(+), 201 deletions(-) create mode 100644 content/params/dns-domain.yaml create mode 100644 content/params/local-repo.yaml create mode 100644 content/params/ntp-servers.yaml create mode 100644 content/params/operating-system-disk.yaml create mode 100644 content/params/part-scheme.yaml create mode 100644 content/params/provisioner-default-fullname.yaml create mode 100644 content/params/provisioner-default-password-hash.yaml create mode 100644 content/params/provisioner-default-uid.yaml create mode 100644 content/params/provisioner-default-user.yaml create mode 100644 content/params/proxy-servers.yaml diff --git a/content/bootenvs/centos-7.4.1708.yml b/content/bootenvs/centos-7.4.1708.yml index 7af602ce..0297a217 100644 --- a/content/bootenvs/centos-7.4.1708.yml +++ b/content/bootenvs/centos-7.4.1708.yml @@ -1,5 +1,6 @@ --- Name: "centos-7.4.1708-install" +Description: "CentOS-7.4.1708 install bootenv" OS: Name: "centos-7.4.1708" IsoFile: "CentOS-7-x86_64-Minimal-1708.iso" @@ -8,13 +9,19 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} inst.geoloc=0 -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + inst.geoloc=0 + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} RequiredParams: OptionalParams: - "operating-system-disk" - "provisioner-default-password-hash" - - "access-keys" - "kernel-console" + - "proxy-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/content/bootenvs/centos-7.yml b/content/bootenvs/centos-7.yml index 78b2ce8f..59af93cc 100644 --- a/content/bootenvs/centos-7.yml +++ b/content/bootenvs/centos-7.yml @@ -1,5 +1,6 @@ --- Name: "centos-7-install" +Description: "CentOS-7 installer that points to the latest CentOS 7 release." OS: Name: "centos-7" IsoFile: "CentOS-7-x86_64-Minimal-1708.iso" @@ -8,13 +9,19 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} inst.geoloc=0 -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +BootParams: + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + inst.geoloc=0 + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} RequiredParams: OptionalParams: - "operating-system-disk" - "provisioner-default-password-hash" - - "access-keys" - "kernel-console" + - "proxy-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/content/bootenvs/debian-8.yml b/content/bootenvs/debian-8.yml index cf7dffa6..29710eab 100644 --- a/content/bootenvs/debian-8.yml +++ b/content/bootenvs/debian-8.yml @@ -39,9 +39,12 @@ OptionalParams: - "provisioner-default-fullname" - "provisioner-default-uid" - "provisioner-default-password-hash" - - "access-keys" - "kernel-console" - "proxy-servers" + - "dns-domain" + - "local-repo" + - "proxy-servers" + - "ntp-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/content/bootenvs/debian-9.yml b/content/bootenvs/debian-9.yml index 0db3d1f5..2a101a5d 100644 --- a/content/bootenvs/debian-9.yml +++ b/content/bootenvs/debian-9.yml @@ -39,8 +39,12 @@ OptionalParams: - "provisioner-default-fullname" - "provisioner-default-uid" - "provisioner-default-password-hash" - - "access-keys" - "kernel-console" + - "proxy-servers" + - "dns-domain" + - "local-repo" + - "proxy-servers" + - "ntp-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/content/bootenvs/discovery.yml b/content/bootenvs/discovery.yml index 362cf78a..4a4f850c 100644 --- a/content/bootenvs/discovery.yml +++ b/content/bootenvs/discovery.yml @@ -1,6 +1,6 @@ --- Name: "discovery" -Description: "The boot environment to use to have unknown machines boot to Sledgehammer" +Description: "The boot environment to use to have unknown machines boot to default Stage/BootEnv" OnlyUnknown: true OS: Name: "sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15" @@ -9,7 +9,21 @@ OS: Kernel: "vmlinuz0" Initrds: - "stage1.img" -BootParams: "rootflags=loop root=live:/sledgehammer.iso rootfstype=auto ro liveimg rd_NO_LUKS rd_NO_MD rd_NO_DM provisioner.web={{.ProvisionerURL}} rs.api={{.ApiURL}} -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +BootParams: >- + rootflags=loop + root=live:/sledgehammer.iso + rootfstype=auto + ro + liveimg + rd_NO_LUKS + rd_NO_MD + rd_NO_DM + provisioner.web={{.ProvisionerURL}} + rs.api={{.ApiURL}} + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} +OptionalParams: + - "kernel-console" Templates: - Name: "pxelinux" Path: "pxelinux.cfg/default" diff --git a/content/bootenvs/sledgehammer.yml b/content/bootenvs/sledgehammer.yml index 2d77b404..e032ce0b 100644 --- a/content/bootenvs/sledgehammer.yml +++ b/content/bootenvs/sledgehammer.yml @@ -3,6 +3,7 @@ # This bootenv requires the start-up.sh file to be rendered by the discovery bootenv. # These two bootenvs are linked and should be used as a pair. Name: "sledgehammer" +Description: "Ram-Only image loaded with tools to allow for discovery and maintenance" OS: Name: "sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15" IsoFile: "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar" @@ -10,10 +11,22 @@ OS: Kernel: "vmlinuz0" Initrds: - "stage1.img" -BootParams: "rootflags=loop root=live:/sledgehammer.iso rootfstype=auto ro liveimg rd_NO_LUKS rd_NO_MD rd_NO_DM provisioner.web={{.ProvisionerURL}} rs.uuid={{.Machine.UUID}} rs.api={{.ApiURL}} -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +BootParams: >- + rootflags=loop + root=live:/sledgehammer.iso + rootfstype=auto + ro + liveimg + rd_NO_LUKS + rd_NO_MD + rd_NO_DM + provisioner.web={{.ProvisionerURL}} + rs.uuid={{.Machine.UUID}} + rs.api={{.ApiURL}} + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} RequiredParams: OptionalParams: - - "access-keys" - "kernel-console" Templates: - Name: "pxelinux" diff --git a/content/bootenvs/ubuntu-16.04.yml b/content/bootenvs/ubuntu-16.04.yml index ee769e1f..673e241d 100644 --- a/content/bootenvs/ubuntu-16.04.yml +++ b/content/bootenvs/ubuntu-16.04.yml @@ -1,5 +1,6 @@ --- Name: "ubuntu-16.04-install" +Description: "Ubuntu-16.04 install points to the latest release version" OS: Name: "ubuntu-16.04" Family: "ubuntu" @@ -10,21 +11,34 @@ OS: Initrds: - "install/netboot/ubuntu-installer/amd64/initrd.gz" Kernel: "install/netboot/ubuntu-installer/amd64/linux" -BootParams: "debian-installer/locale=en_US.utf8 console-setup/layoutcode=us keyboard-configuration/layoutcode=us - netcfg/dhcp_timeout=120 netcfg/choose_interface=auto url={{.Machine.Url}}/seed netcfg/get_hostname={{.Machine.Name}} - root=/dev/ram rw quiet {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}} -- - {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" +BootParams: >- + debian-installer/locale=en_US.utf8 + console-setup/layoutcode=us + keyboard-configuration/layoutcode=us + netcfg/dhcp_timeout=120 + netcfg/choose_interface=auto + url={{.Machine.Url}}/seed + netcfg/get_hostname={{.Machine.Name}} + root=/dev/ram + rw + quiet + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} RequiredParams: OptionalParams: - "part-scheme" - "operating-system-disk" - - "provisioner-default-password-hash" - "provisioner-default-user" - - "access-keys" + - "provisioner-default-fullname" + - "provisioner-default-uid" + - "provisioner-default-password-hash" - "kernel-console" - "proxy-servers" - - "ntp-servers" - "dns-domain" + - "local-repo" + - "proxy-servers" + - "ntp-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/content/params/access-keys.yaml b/content/params/access-keys.yaml index 94837e13..c84366d3 100644 --- a/content/params/access-keys.yaml +++ b/content/params/access-keys.yaml @@ -12,6 +12,6 @@ Schema: additionalProperties: type: "string" Meta: - icon: key - color: blue - title: RackN Content \ No newline at end of file + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/access-ssh-root-mode.yaml b/content/params/access-ssh-root-mode.yaml index 598d142a..0672a888 100644 --- a/content/params/access-ssh-root-mode.yaml +++ b/content/params/access-ssh-root-mode.yaml @@ -14,6 +14,6 @@ Schema: type: "string" Meta: - icon: unlock - color: blue - title: RackN Content \ No newline at end of file + icon: "unlock" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/change-stage.map.yaml b/content/params/change-stage.map.yaml index 542dd175..e0fd1e23 100644 --- a/content/params/change-stage.map.yaml +++ b/content/params/change-stage.map.yaml @@ -12,6 +12,6 @@ Schema: additionalProperties: type: "string" Meta: - icon: shuffle - color: blue - title: RackN Content \ No newline at end of file + icon: "shuffle" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/dns-domain.yaml b/content/params/dns-domain.yaml new file mode 100644 index 00000000..54e58ca6 --- /dev/null +++ b/content/params/dns-domain.yaml @@ -0,0 +1,14 @@ +--- +Name: "dns-domain" +Description: "DNS Domain to append to hostname." +Documentation: | + This is used currently in the Ubuntu/Debian preseed file to specify the DNS Domain Name of the host. + + This may be in flux. + +Schema: + type: "string" +Meta: + icon: "tag" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/gohai-inventory.yaml b/content/params/gohai-inventory.yaml index 3744b56f..9be07abd 100644 --- a/content/params/gohai-inventory.yaml +++ b/content/params/gohai-inventory.yaml @@ -1,7 +1,11 @@ --- -Name: gohai-inventory -Description: System inventory as reported by Gohai +Name: "gohai-inventory" +Description: "System inventory as reported by Gohai" +Documentation: | + This provides an untyped dictionary of values from Gohai. + + This is fairly raw data. Other parameters are distilled from this. Meta: - icon: search - color: blue - title: RackN Content + icon: "search" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/kernel-console.yaml b/content/params/kernel-console.yaml index 3e47bba2..3edad131 100644 --- a/content/params/kernel-console.yaml +++ b/content/params/kernel-console.yaml @@ -10,6 +10,6 @@ Schema: type: "string" Meta: - icon: desktop - color: blue - title: RackN Content \ No newline at end of file + icon: "desktop" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/local-repo.yaml b/content/params/local-repo.yaml new file mode 100644 index 00000000..d2a3c45c --- /dev/null +++ b/content/params/local-repo.yaml @@ -0,0 +1,14 @@ +--- +Name: "local-repo" +Description: "Indicates that the install should use the local exploded iso as the install repo" +Documentation: | + Boolean value that tells the install steps to only use the local exploded iso on the + DRP server as the only installation repo. + +Schema: + type: "boolean" + +Meta: + icon: "greg" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/ntp-servers.yaml b/content/params/ntp-servers.yaml new file mode 100644 index 00000000..bb4f64fb --- /dev/null +++ b/content/params/ntp-servers.yaml @@ -0,0 +1,16 @@ +--- +Name: "ntp-servers" +Description: "Defines the set of NTP servers to apply to the system." +Documentation: | + This is an array of strings where each string an IP address or Name of + an NTP server. + +Schema: + type: "array" + items: + type: "string" + +Meta: + icon: "time" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/operating-system-disk.yaml b/content/params/operating-system-disk.yaml new file mode 100644 index 00000000..2bdcda77 --- /dev/null +++ b/content/params/operating-system-disk.yaml @@ -0,0 +1,17 @@ +--- +Name: "operating-system-disk" +Description: "Defines the disk the installer should use" +Documentation: | + Defines the disk the installer should use for OS installation. The usage of this + parameter inside a template should add a /dev/ if required. The value should just + be the disk simple name. + + e.g. sda + +Schema: + type: "string" + +Meta: + icon: "disk outline" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/part-scheme.yaml b/content/params/part-scheme.yaml new file mode 100644 index 00000000..ef2a16b9 --- /dev/null +++ b/content/params/part-scheme.yaml @@ -0,0 +1,20 @@ +--- +Name: "part-scheme" +Description: "Defines a string that references a template for partitioning during installation." +Documentation: | + This string contains the name of a template that holds the Debian installer partitioning + commands for use during installation. + + The string will be expanded into this template name: + + part-seed-.tmpl + + e.g. softraid + +Schema: + type: "string" + +Meta: + icon: "disk outline" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/provisioner-default-fullname.yaml b/content/params/provisioner-default-fullname.yaml new file mode 100644 index 00000000..73c15a54 --- /dev/null +++ b/content/params/provisioner-default-fullname.yaml @@ -0,0 +1,13 @@ +--- +Name: "provisioner-default-fullname" +Description: "Defines full name of the default user" +Documentation: | + Used in the Debian/Ubuntu installers to specify the full name of the default user. + +Schema: + type: "string" + +Meta: + icon: "user" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/provisioner-default-password-hash.yaml b/content/params/provisioner-default-password-hash.yaml new file mode 100644 index 00000000..8c68abc5 --- /dev/null +++ b/content/params/provisioner-default-password-hash.yaml @@ -0,0 +1,22 @@ +--- +Name: "provisioner-default-password-hash" +Description: "Defines the password of the default user in hash form" +Documentation: | + This specifies the password hash to use for the install process. This is the + root password on CentOS-based installs and the default user on the Debian-based + installs. + + To generate a hash, use the following command: + + echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$16_CHARACTER_SALT_HERE")' | python - + + Set your 16 character salt in the correct place. This generate sha512 hash which should work on both + operating system types. + +Schema: + type: "string" + +Meta: + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/provisioner-default-uid.yaml b/content/params/provisioner-default-uid.yaml new file mode 100644 index 00000000..e56415bc --- /dev/null +++ b/content/params/provisioner-default-uid.yaml @@ -0,0 +1,15 @@ +--- +Name: "provisioner-default-uid" +Description: "Defines uid to use for the default user" +Documentation: | + Used in the Debian/Ubuntu installers to specify the uid of the default user. + + The value is a string for of the integer value. + +Schema: + type: "string" + +Meta: + icon: "user" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/provisioner-default-user.yaml b/content/params/provisioner-default-user.yaml new file mode 100644 index 00000000..dd0b7354 --- /dev/null +++ b/content/params/provisioner-default-user.yaml @@ -0,0 +1,13 @@ +--- +Name: "provisioner-default-user" +Description: "Defines the username of the default user" +Documentation: | + Used in the Debian/Ubuntu installers to specify the username of the default user. + +Schema: + type: "string" + +Meta: + icon: "user" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/proxy-servers.yaml b/content/params/proxy-servers.yaml new file mode 100644 index 00000000..ba36ffc9 --- /dev/null +++ b/content/params/proxy-servers.yaml @@ -0,0 +1,17 @@ +--- +Name: "proxy-servers" +Description: "Defines the set of HTTP proxy servers to apply to the system." +Documentation: | + This is an array of URLs where each string is an HTTP proxy server to references. + + The URLs can be names or IPs with ports and schemas. + +Schema: + type: "array" + items: + type: "string" + +Meta: + icon: "browser" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/profiles/root-access-example.yml b/content/profiles/root-access-example.yml index a3cb2724..7d1ce033 100644 --- a/content/profiles/root-access-example.yml +++ b/content/profiles/root-access-example.yml @@ -1,4 +1,5 @@ -Name: root-access-example +Name: "root-access-example" +Description: "Example profile for setting the access-keys and access-ssh-root-mode parameters" Params: access-keys: greg: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDvqrpVfs9MXwjleLNPICcjAMviF3FJq85sMAe/4ejNDLMOcjDIFz4aQxrZx6sPlaqWADdy9XADaKgaYZwNssE9s6GNGJVORXl+vacLslwcrWo7aThzfKSlkn6wul3PcVjvIINQGiH/sUznLT8zUGR0hWX2Pds80iSxaQhIoFC8+DEVPSr5CIlliaCiYmwBB2FjBvR6ryltqxx3PIjJ4RwiP77DV6kdkG2khdY2XB7WLJptlgrg2U20TKG/9LrBqPFcM/m0BEmp01xN60A/O5Iw+vTXQoR3CX0mlNIzQIeAbtqau+uPkzd2TPzNOZebEvOnw1MxJPLjLqvxXRw54Bt9 galthaus@Gregs-MacBook-Pro.local diff --git a/content/stages/centos-7.4.1708.yml b/content/stages/centos-7.4.1708.yml index d25d87c9..97627d9b 100644 --- a/content/stages/centos-7.4.1708.yml +++ b/content/stages/centos-7.4.1708.yml @@ -1,15 +1,14 @@ --- Name: "centos-7.4.1708-install" +Description: "CentOS 7.4.1708 install stage." BootEnv: "centos-7.4.1708-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/centos-7.yml b/content/stages/centos-7.yml index e84eb843..4f1e9d9c 100644 --- a/content/stages/centos-7.yml +++ b/content/stages/centos-7.yml @@ -1,15 +1,14 @@ --- Name: "centos-7-install" +Description: "CentOS 7 install stages. References the latest CentOS 7 release" BootEnv: "centos-7-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/complete-nowait.yaml b/content/stages/complete-nowait.yaml index 023f85b2..13d08e57 100644 --- a/content/stages/complete-nowait.yaml +++ b/content/stages/complete-nowait.yaml @@ -1,8 +1,8 @@ --- Name: "complete-nowait" +Descrption: "Stage that represents workflow completion to local disk. Does NOT change stages" BootEnv: "local" Meta: - icon: checkmark - color: green - title: RackN Content - + icon: "checkmark" + color: "green" + title: "Digital Rebar Community Content" diff --git a/content/stages/complete.yml b/content/stages/complete.yml index 106c58db..ea6a645b 100644 --- a/content/stages/complete.yml +++ b/content/stages/complete.yml @@ -1,8 +1,9 @@ --- Name: "complete" +Description: "Stage that represents workflow completion to local disk boot but leaves the runner running." BootEnv: "local" RunnerWait: true Meta: icon: "check circle outline" - color: green - title: RackN Content + color: "green" + title: "Digital Rebar Community Content" diff --git a/content/stages/debian-8.yml b/content/stages/debian-8.yml index 71ae341c..fcbc74dc 100644 --- a/content/stages/debian-8.yml +++ b/content/stages/debian-8.yml @@ -1,14 +1,13 @@ --- Name: "debian-8-install" +Description: "Debian 8 install stage. References latest debian 8 install image." BootEnv: "debian-8-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "ubuntu-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/debian-9.yml b/content/stages/debian-9.yml index 3392386e..d0c7c242 100644 --- a/content/stages/debian-9.yml +++ b/content/stages/debian-9.yml @@ -1,14 +1,13 @@ --- Name: "debian-9-install" +Description: "Debian 9 install stage. References the latest Debian 9 image" BootEnv: "debian-9-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "ubuntu-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/discover.yaml b/content/stages/discover.yaml index 4a003fd5..9d4b4a1c 100644 --- a/content/stages/discover.yaml +++ b/content/stages/discover.yaml @@ -1,16 +1,13 @@ --- Name: "discover" +Description: "Discovery stage used to inventory and baseline new machines" BootEnv: "sledgehammer" RunnerWait: true -OptionalParams: - - "change-stage/map" - - "access-keys" - - "access-ssh-root-mode" Tasks: - "gohai" - "ssh-access" - "change-stage" Meta: - icon: spinner - color: yellow - title: RackN Content + icon: "spinner" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/finish-install.yaml b/content/stages/finish-install.yaml index 2042763f..050094ec 100644 --- a/content/stages/finish-install.yaml +++ b/content/stages/finish-install.yaml @@ -1,10 +1,10 @@ --- Name: "finish-install" +Description: "Used with the STOP runner action to leave a stage that will have a task on machine boot" BootEnv: "local" Tasks: - "change-stage" Meta: - icon: checkmark - color: yellow - title: RackN Content - + icon: "checkmark" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/sledgehammer-wait.yaml b/content/stages/sledgehammer-wait.yaml index 903d8839..85572ee0 100644 --- a/content/stages/sledgehammer-wait.yaml +++ b/content/stages/sledgehammer-wait.yaml @@ -4,6 +4,6 @@ Description: "Wait for more tasks in sledgehammer - useful for debugging" BootEnv: "sledgehammer" RunnerWait: true Meta: - icon: hand paper - color: yellow - title: RackN Content + icon: "hand paper" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/ssh-access.yaml b/content/stages/ssh-access.yaml index ba56dbc6..9a373b0c 100644 --- a/content/stages/ssh-access.yaml +++ b/content/stages/ssh-access.yaml @@ -1,14 +1,11 @@ --- Name: "ssh-access" +Description: "Stage that installs SSH keys and configure SSH access policy" RunnerWait: true -OptionalParams: - - "change-stage/map" - - "access-keys" - - "access-ssh-root-mode" Tasks: - "ssh-access" - "change-stage" Meta: - icon: key - color: yellow - title: RackN Content + icon: "key" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/ubuntu-16.04.yml b/content/stages/ubuntu-16.04.yml index 56722d74..34e70a56 100644 --- a/content/stages/ubuntu-16.04.yml +++ b/content/stages/ubuntu-16.04.yml @@ -1,14 +1,13 @@ --- Name: "ubuntu-16.04-install" +Description: "Ubuntu 16.04 installation stage. References latest release" BootEnv: "ubuntu-16.04-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "ubuntu-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/tasks/centos-drp-only-repos.yaml b/content/tasks/centos-drp-only-repos.yaml index 960818f7..fcdf8bfb 100644 --- a/content/tasks/centos-drp-only-repos.yaml +++ b/content/tasks/centos-drp-only-repos.yaml @@ -1,13 +1,13 @@ -Description: A task to force the node to switch DRP hosted-only repos. -Name: centos-drp-only-repos +--- +Description: "A task to force the machine to switch to DRP hosted-only centos repos." +Name: "centos-drp-only-repos" OptionalParams: - - local-repo -RequiredParams: null + - "local-repo" Templates: - - ID: centos-drp-only-repos.sh.tmpl - Name: Force node to install from drp hosted repos + - ID: "centos-drp-only-repos.sh.tmpl" + Name: "Force node to install from drp hosted repos" Path: "" Meta: - icon: key - color: blue - title: RackN Content + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/tasks/change-stage.yaml b/content/tasks/change-stage.yaml index 630697be..c9a52a5b 100644 --- a/content/tasks/change-stage.yaml +++ b/content/tasks/change-stage.yaml @@ -1,13 +1,14 @@ -Description: A task to change stages -Name: change-stage -OptionalParams: null -RequiredParams: null +--- +Description: "A task to change stages" +Name: "change-stage" +RequiredParams: +- "change-stage/map" Templates: -- ID: change-stage.sh.tmpl - Name: Change stage +- ID: "change-stage.sh.tmpl" + Name: "Change stage" Path: "" Meta: - icon: shuffle - color: blue - title: RackN Content + icon: "shuffle" + color: "blue" + title: "Digital Rebar Community Content" feature-flags: "sane-exit-codes" diff --git a/content/tasks/gohai.yaml b/content/tasks/gohai.yaml index 90dc3753..97c534b3 100644 --- a/content/tasks/gohai.yaml +++ b/content/tasks/gohai.yaml @@ -1,13 +1,13 @@ --- -Name: gohai -Description: Get basic system inventory using Gohai +Name: "gohai" +Description: "Get basic system inventory using Gohai" Templates: - - Name: gohai + - Name: "gohai" Contents: | #!/usr/bin/env bash drpcli machines set {{.Machine.UUID}} set gohai-inventory to "$(gohai)" Meta: - icon: search - color: blue - title: RackN Content + icon: "search" + color: "blue" + title: "Digital Rebar Community Content" feature-flags: "sane-exit-codes" diff --git a/content/tasks/set-hostname.yaml b/content/tasks/set-hostname.yaml index 3a1daed0..d5679f55 100644 --- a/content/tasks/set-hostname.yaml +++ b/content/tasks/set-hostname.yaml @@ -1,12 +1,11 @@ -Description: A task to set the hostname -Name: set-hostname -OptionalParams: null -RequiredParams: null +--- +Description: "A task to set the hostname" +Name: "set-hostname" Templates: - - ID: set-hostname.sh.tmpl - Name: Set the hostname on the machine + - ID: "set-hostname.sh.tmpl" + Name: "Set the hostname on the machine" Path: "" Meta: - icon: key - color: blue - title: RackN Content + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/tasks/ssh-access.yaml b/content/tasks/ssh-access.yaml index 2a96772e..b160d125 100644 --- a/content/tasks/ssh-access.yaml +++ b/content/tasks/ssh-access.yaml @@ -1,13 +1,14 @@ -Description: A task to put root ssh keys in place -Name: ssh-access +--- +Description: "A task to put root ssh keys in place" +Name: "ssh-access" OptionalParams: - - access-keys -RequiredParams: null + - "access-keys" + - "access-ssh-root-mode" Templates: - - ID: access-keys.sh.tmpl - Name: Put access keys in place for root user + - ID: "access-keys.sh.tmpl" + Name: "Put access keys in place for root user" Path: "" Meta: - icon: key - color: blue - title: RackN Content + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/tasks/ubuntu-drp-only-repos.yaml b/content/tasks/ubuntu-drp-only-repos.yaml index 9ca5627a..4b8a13c5 100644 --- a/content/tasks/ubuntu-drp-only-repos.yaml +++ b/content/tasks/ubuntu-drp-only-repos.yaml @@ -1,13 +1,13 @@ -Description: A task to force the node to switch DRP hosted-only repos. -Name: ubuntu-drp-only-repos +--- +Description: "A task to force the node to switch to DRP hosted-only ubuntu repos." +Name: "ubuntu-drp-only-repos" OptionalParams: - - local-repo -RequiredParams: null + - "local-repo" Templates: - - ID: ubuntu-drp-only-repos.sh.tmpl - Name: Force node to install from drp hosted repos + - ID: "ubuntu-drp-only-repos.sh.tmpl" + Name: "Force node to install from drp hosted repos" Path: "" Meta: - icon: key - color: blue - title: RackN Content + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/templates/access-keys.sh.tmpl b/content/templates/access-keys.sh.tmpl index eaca8f85..abc7a2f8 100644 --- a/content/templates/access-keys.sh.tmpl +++ b/content/templates/access-keys.sh.tmpl @@ -4,7 +4,7 @@ # and makes sure that the sshd config for PermitRootLogin is populated. # # Runs as part of a shell script for kickstart or net-post-install -# The template does nothing if proxy-servers is undefined +# The template does nothing if access-keys is undefined # # Required Parameters: access-keys # Optional Parameters: access-ssh-root-mode diff --git a/content/templates/centos-7.ks.tmpl b/content/templates/centos-7.ks.tmpl index 4e984dbb..663358c9 100644 --- a/content/templates/centos-7.ks.tmpl +++ b/content/templates/centos-7.ks.tmpl @@ -3,7 +3,7 @@ install url --url {{.Env.InstallUrl}} # Add support for our local proxy. -repo --name="CentOS" --baseurl={{.Env.InstallUrl}} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0 "url"}}"{{end}} --cost=100 +repo --name="CentOS" --baseurl={{.Env.InstallUrl}} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0}}"{{end}} --cost=100 # key --skip # Disable geolocation for language and timezone # Currently broken by https://bugzilla.redhat.com/show_bug.cgi?id=1111717 diff --git a/content/templates/centos-drp-only-repos.sh.tmpl b/content/templates/centos-drp-only-repos.sh.tmpl index 666e169b..fcc4aab6 100644 --- a/content/templates/centos-drp-only-repos.sh.tmpl +++ b/content/templates/centos-drp-only-repos.sh.tmpl @@ -1,22 +1,22 @@ #!/bin/bash -{{ if .ParamExists "local_repo" }} -{{ if eq (.Param "local_repo") true }} +{{ if .ParamExists "local-repo" }} +{{ if eq (.Param "local-repo") true }} # # This template forces a yum-based install # to use only the local DRP provided repo. # # Runs as part of a shell script for kickstart -# The template does is only functional if local_repo is true. +# The template does is only functional if local-repo is true. # -# Required Parameters: local_repo +# Required Parameters: local-repo # Optional Parameters: # # Parameter YAML format: # -# local_repo: true +# local-repo: true # # Defaults: -# local_repo - Function is enabled if and only local_repo is true +# local-repo - Function is enabled if and only local-repo is true # (cd /etc/yum.repos.d; rm -f * || :) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index b9652ca1..aed52782 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -51,19 +51,19 @@ d-i apt-setup/security_path string /ubuntu {{end -}} {{end -}} {{if .ParamExists "proxy-servers"}} -d-i mirror/http/proxy string {{index (.Param "proxy-servers") 0 "url"}} +d-i mirror/http/proxy string {{index (.Param "proxy-servers") 0}} {{else}} d-i mirror/http/proxy string {{end}} # Clock d-i clock-setup/utc boolean true -{{if .ParamExists "ntp_servers" -}} +{{if .ParamExists "ntp-servers" -}} d-i clock-setup/ntp boolean true -d-i clock-setup/ntp-server string {{index (.Param "ntp_servers") 0}} +d-i clock-setup/ntp-server string {{index (.Param "ntp-servers") 0}} {{else -}} d-i clock-setup/ntp boolean false -{{end -}} +{{end -}- d-i time/zone string UTC # Partitioner Label Default (GPT) diff --git a/contrib/bootenvs/centos-6.9.yml b/contrib/bootenvs/centos-6.9.yml index 4c08a72a..11fd1ae3 100644 --- a/contrib/bootenvs/centos-6.9.yml +++ b/contrib/bootenvs/centos-6.9.yml @@ -1,5 +1,6 @@ --- Name: "centos-6.9-install" +Description: "CentOS-6.9 install bootenv" OS: Name: "centos-6.9" IsoFile: "CentOS-6.9-x86_64-bin-DVD1.iso" @@ -8,14 +9,17 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" -RequiredParams: +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} OptionalParams: - - "ntp-servers" - "operating-system-disk" - "provisioner-default-password-hash" - "proxy-servers" - - "access-keys" + - "kernel-console" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/contrib/bootenvs/centos-6.yml b/contrib/bootenvs/centos-6.yml index 9d4981ef..8b252c59 100644 --- a/contrib/bootenvs/centos-6.yml +++ b/contrib/bootenvs/centos-6.yml @@ -1,5 +1,6 @@ --- Name: "centos-6-install" +Description: "CentOS 6 install bootenv that references the latest release" OS: Name: "centos-6" IsoFile: "CentOS-6.9-x86_64-bin-DVD1.iso" @@ -8,14 +9,17 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" -RequiredParams: +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} OptionalParams: - - "ntp-servers" - "operating-system-disk" - "provisioner-default-password-hash" - "proxy-servers" - - "access-keys" + - "kernel-console" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/contrib/bootenvs/centos-7.3.1611.yml b/contrib/bootenvs/centos-7.3.1611.yml index 679ac7b6..0989e547 100644 --- a/contrib/bootenvs/centos-7.3.1611.yml +++ b/contrib/bootenvs/centos-7.3.1611.yml @@ -1,5 +1,6 @@ --- Name: "centos-7.3.1611-install" +Description: "CentOS 7.3.1611 install bootenv" OS: Name: "centos-7.3.1611" IsoFile: "CentOS-7-x86_64-Minimal-1611.iso" @@ -8,14 +9,18 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} inst.geoloc=0 -- {{if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\"}}{{end}}" -RequiredParams: +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + inst.geoloc=0 + -- + {{if .ParamExists "kernel-console"}}{{.Param "kernel-console"}}{{end}} OptionalParams: - "operating-system-disk" - "provisioner-default-password-hash" - - "access-keys" - - "kernel-console" - "proxy-servers" + - "kernel-console" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/contrib/bootenvs/scientificlinux-6.8.yml b/contrib/bootenvs/scientificlinux-6.8.yml index 6edc1f18..2488513c 100644 --- a/contrib/bootenvs/scientificlinux-6.8.yml +++ b/contrib/bootenvs/scientificlinux-6.8.yml @@ -1,5 +1,6 @@ --- Name: "scientificlinux-6.8-install" +Description: "Scientific Linux 6.8 install bootenv" OS: Name: "scientificlinux-6.8" IsoFile: "SL-68-x86_64-2016-06-29-DVD-DL.iso" @@ -8,14 +9,17 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: "ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} -- {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" -RequiredParams: +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} OptionalParams: - - "ntp-servers" - "operating-system-disk" - "provisioner-default-password-hash" - "proxy-servers" - - "access-keys" + - "kernel-console" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/contrib/bootenvs/ubuntu-14.04.yml b/contrib/bootenvs/ubuntu-14.04.yml index aa61fe41..b5dbbd6d 100644 --- a/contrib/bootenvs/ubuntu-14.04.yml +++ b/contrib/bootenvs/ubuntu-14.04.yml @@ -1,5 +1,6 @@ --- Name: "ubuntu-14.04-install" +Description: "Ubuntu 14.04 install bootenv that references latest release" OS: Name: "ubuntu-14.04" Version: "14.04" @@ -10,19 +11,33 @@ OS: Kernel: "install/netboot/ubuntu-installer/amd64/linux" Initrds: - "install/netboot/ubuntu-installer/amd64/initrd.gz" -BootParams: "debian-installer/locale=en_US.utf8 console-setup/layoutcode=us keyboard-configuration/layoutcode=us - netcfg/dhcp_timeout=120 netcfg/choose_interface=auto url={{.Machine.Url}}/seed netcfg/get_hostname={{.Machine.Name}} - root=/dev/ram rw quiet {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }} -- - {{ if .ParamExists \"kernel-console\"}}{{.Param \"kernel-console\" }}{{ end }}" -RequiredParams: +BootParams: >- + debian-installer/locale=en_US.utf8 + console-setup/layoutcode=us + keyboard-configuration/layoutcode=us + netcfg/dhcp_timeout=120 + netcfg/choose_interface=auto + url={{.Machine.Url}}/seed + netcfg/get_hostname={{.Machine.Name}} + root=/dev/ram + rw + quiet + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} OptionalParams: - - "dns-domain" - - "ntp-servers" + - "part-scheme" - "operating-system-disk" - - "provisioner-default-password-hash" - "provisioner-default-user" + - "provisioner-default-fullname" + - "provisioner-default-uid" + - "provisioner-default-password-hash" + - "kernel-console" - "proxy-servers" - - "access-keys" + - "dns-domain" + - "local-repo" + - "proxy-servers" + - "ntp-servers" Templates: - ID: "default-pxelinux.tmpl" Name: "pxelinux" diff --git a/contrib/stages/centos-6.9.yml b/contrib/stages/centos-6.9.yml index e6e00adc..41b6539e 100644 --- a/contrib/stages/centos-6.9.yml +++ b/contrib/stages/centos-6.9.yml @@ -1,15 +1,14 @@ --- Name: "centos-6.9-install" +Description: "CentOS 6.9 install stage" BootEnv: "centos-6.9-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/stages/centos-6.yml b/contrib/stages/centos-6.yml index ced95f18..00283c69 100644 --- a/contrib/stages/centos-6.yml +++ b/contrib/stages/centos-6.yml @@ -1,15 +1,14 @@ --- Name: "centos-6-install" +Description: "CentOS 6 install stage that references the latest version" BootEnv: "centos-6-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/stages/centos-7.3.1611.yml b/contrib/stages/centos-7.3.1611.yml index 373fb319..317ba3de 100644 --- a/contrib/stages/centos-7.3.1611.yml +++ b/contrib/stages/centos-7.3.1611.yml @@ -1,15 +1,14 @@ --- Name: "centos-7.3.1611-install" +Description: "CentOS 7.3.1611 install stage" BootEnv: "centos-7.3.1611-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/stages/scientificlinux-6.8.yml b/contrib/stages/scientificlinux-6.8.yml index 1f78d3c7..ee997ce2 100644 --- a/contrib/stages/scientificlinux-6.8.yml +++ b/contrib/stages/scientificlinux-6.8.yml @@ -1,15 +1,14 @@ --- Name: "scientificlinux-6.8-install" +Description: "Scientific Linux 6.8 install stage" BootEnv: "scientificlinux-6.8-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "set-hostname" - "centos-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/stages/ubuntu-14.04.yml b/contrib/stages/ubuntu-14.04.yml index bcc3fc36..bddf6198 100644 --- a/contrib/stages/ubuntu-14.04.yml +++ b/contrib/stages/ubuntu-14.04.yml @@ -1,14 +1,13 @@ --- Name: "ubuntu-14.04-install" +Description: "Ubuntu 14.04 install stage that references latest release" BootEnv: "ubuntu-14.04-install" RunnerWait: true -OptionalParams: - - "change-stage/map" Tasks: - "ubuntu-drp-only-repos" - "ssh-access" - "change-stage" Meta: - icon: download - color: yellow - title: RackN Content + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/templates/centos-6.ks.tmpl b/contrib/templates/centos-6.ks.tmpl index ef69b8b4..da0f97a5 100644 --- a/contrib/templates/centos-6.ks.tmpl +++ b/contrib/templates/centos-6.ks.tmpl @@ -3,7 +3,7 @@ install url --url {{ .Env.InstallUrl }} # Add support for our local proxy. -repo --name="CentOS" --baseurl={{ .Env.InstallUrl }} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0 "url"}}"{{end}} --cost=100 +repo --name="CentOS" --baseurl={{ .Env.InstallUrl }} {{if .ParamExists "proxy-servers"}} --proxy="{{index (.Param "proxy-servers") 0}}"{{end}} --cost=100 key --skip lang en_US.UTF-8 keyboard us From 9c8af2f42fbc0d26e4f54b825598bae2a4a330df Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Mon, 30 Oct 2017 11:49:35 -0500 Subject: [PATCH 14/25] Fix busted end --- content/templates/net-seed.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index aed52782..c9991f08 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -63,7 +63,7 @@ d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string {{index (.Param "ntp-servers") 0}} {{else -}} d-i clock-setup/ntp boolean false -{{end -}- +{{end -}} d-i time/zone string UTC # Partitioner Label Default (GPT) From e73290f04763575c4d2c7f7fb53d12cbf5001282 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Mon, 30 Oct 2017 11:52:55 -0500 Subject: [PATCH 15/25] Fix description in complete-nowait --- content/stages/complete-nowait.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/stages/complete-nowait.yaml b/content/stages/complete-nowait.yaml index 13d08e57..46e0af4f 100644 --- a/content/stages/complete-nowait.yaml +++ b/content/stages/complete-nowait.yaml @@ -1,6 +1,6 @@ --- Name: "complete-nowait" -Descrption: "Stage that represents workflow completion to local disk. Does NOT change stages" +Description: "Stage that represents workflow completion to local disk. Does NOT change stages" BootEnv: "local" Meta: icon: "checkmark" From 92e93693758e31db30aa23e687fe6fae0fa945cd Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Mon, 30 Oct 2017 12:12:55 -0500 Subject: [PATCH 16/25] Add missing icon and missing metadata --- content/params/local-repo.yaml | 2 +- content/profiles/root-access-example.yml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/content/params/local-repo.yaml b/content/params/local-repo.yaml index d2a3c45c..809f6501 100644 --- a/content/params/local-repo.yaml +++ b/content/params/local-repo.yaml @@ -9,6 +9,6 @@ Schema: type: "boolean" Meta: - icon: "greg" + icon: "database" color: "blue" title: "Digital Rebar Community Content" diff --git a/content/profiles/root-access-example.yml b/content/profiles/root-access-example.yml index 7d1ce033..21e7a4d8 100644 --- a/content/profiles/root-access-example.yml +++ b/content/profiles/root-access-example.yml @@ -1,3 +1,4 @@ +--- Name: "root-access-example" Description: "Example profile for setting the access-keys and access-ssh-root-mode parameters" Params: @@ -6,4 +7,6 @@ Params: # access-ssh-root-mode can be specified to change how Root can be accessed # Values: "without-password|yes|no|forced-commands-only" access-ssh-root-mode: without-password - +Meta: + color: "blue" + icon: "key" From 214cde19edb831ec96adb12ef2791923597d2c53 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Mon, 30 Oct 2017 14:31:05 -0500 Subject: [PATCH 17/25] Add description to Debian bootenvs --- content/bootenvs/debian-8.yml | 1 + content/bootenvs/debian-9.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/content/bootenvs/debian-8.yml b/content/bootenvs/debian-8.yml index 29710eab..08190de5 100644 --- a/content/bootenvs/debian-8.yml +++ b/content/bootenvs/debian-8.yml @@ -1,5 +1,6 @@ --- Name: "debian-8-install" +Description: "Debian 8 install BootEnv" OS: Name: "debian-8" Family: "debian" diff --git a/content/bootenvs/debian-9.yml b/content/bootenvs/debian-9.yml index 2a101a5d..a5f97a6d 100644 --- a/content/bootenvs/debian-9.yml +++ b/content/bootenvs/debian-9.yml @@ -1,5 +1,6 @@ --- Name: "debian-9-install" +Description: "Debian 9 install BootEnv" OS: Name: "debian-9" Family: "debian" From 73d54522698b7df7920c8b536a50fbc8d8a16d59 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 31 Oct 2017 12:35:31 -0500 Subject: [PATCH 18/25] Fix centos-7 to have good yaml syntax Add reverse DNS lookup to get HOSTNAME. --- content/bootenvs/centos-7.yml | 2 +- content/bootenvs/discovery.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/content/bootenvs/centos-7.yml b/content/bootenvs/centos-7.yml index 59af93cc..43575623 100644 --- a/content/bootenvs/centos-7.yml +++ b/content/bootenvs/centos-7.yml @@ -9,7 +9,7 @@ OS: Kernel: "images/pxeboot/vmlinuz" Initrds: - "images/pxeboot/initrd.img" -BootParams: +BootParams: >- ksdevice=bootif ks={{.Machine.Url}}/compute.ks method={{.Env.InstallUrl}} diff --git a/content/bootenvs/discovery.yml b/content/bootenvs/discovery.yml index 4a4f850c..07761f69 100644 --- a/content/bootenvs/discovery.yml +++ b/content/bootenvs/discovery.yml @@ -78,6 +78,7 @@ Templates: host_re='rs\.uuid=([^ ]+)' api_re='rs\.api=([^ ]+)' hostname_re='option host-name "([^"]+)' + fixed_ip='fixed-address ([0-9a-f.:]+)' uuid_re='^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$' netname_re='"network":"([^ ]+)"' @@ -92,6 +93,13 @@ Templates: else HOSTNAME="$dhcp_hostname" fi + else + dhcp_ip="$(dhcp_param "$fixed_ip")" + lookup_1=$(getent hosts $dhcp_ip | awk '{print $2}') + lookup_2=$(getent hosts $dhcp_ip | awk '{print $2}') + if [ ! -z $lookup_1 ] && [ $lookup_1 == $lookup_2 ]; then + HOSTNAME=$lookup_1 + fi fi export RS_ENDPOINT="$(get_param "$api_re")" if ! [[ -x /usr/bin/drpcli ]]; then From 96aad9260a573f9f316339c09892a91795b48657 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 31 Oct 2017 12:40:32 -0500 Subject: [PATCH 19/25] Switch sledgehammer to a known machine token. --- content/bootenvs/sledgehammer.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/bootenvs/sledgehammer.yml b/content/bootenvs/sledgehammer.yml index e032ce0b..e6d2b842 100644 --- a/content/bootenvs/sledgehammer.yml +++ b/content/bootenvs/sledgehammer.yml @@ -85,6 +85,10 @@ Templates: export PS4="${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): " cp /usr/share/zoneinfo/GMT /etc/localtime + # This will contain a token appropriate for the path being + # used below. Reset the token to the longer machine token. + export RS_TOKEN="{{.GenerateToken}}" + {{template "runner.tmpl" .}} # The last line in this script must always be exit 0!! From fbe9e2419e22822aca037b5fc868f0e186eee6f6 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 31 Oct 2017 15:09:32 -0500 Subject: [PATCH 20/25] Change-stage/map is not required, but desirable --- content/tasks/change-stage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tasks/change-stage.yaml b/content/tasks/change-stage.yaml index c9a52a5b..44d46f56 100644 --- a/content/tasks/change-stage.yaml +++ b/content/tasks/change-stage.yaml @@ -1,7 +1,7 @@ --- Description: "A task to change stages" Name: "change-stage" -RequiredParams: +OptionalParams: - "change-stage/map" Templates: - ID: "change-stage.sh.tmpl" From 9f9048d709015f56132defa390823e5fb0db4ccf Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 31 Oct 2017 16:41:08 -0500 Subject: [PATCH 21/25] Fix debian installs to use the right security url --- content/templates/net-seed.tmpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index c9991f08..d2d9f872 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -28,9 +28,7 @@ d-i mirror/country string manual d-i mirror/protocol string http d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian -{{if (eq "debian-8" .Env.OS.Name) -}} -d-i apt-setup/security_host string security.debian.org/debian-security -{{end -}} +d-i apt-setup/security_host string security.debian.org {{else -}} {{if .ParamExists "local-repo" -}} {{if eq (.Param "local-repo") true}} From 7454b8bb722eb0a9833fdc3cbb672f2ee4eecc6b Mon Sep 17 00:00:00 2001 From: Musee Ullah Date: Tue, 31 Oct 2017 14:54:03 -0700 Subject: [PATCH 22/25] Allow local-repo to be defined for both Debian/Ubuntu Ensure that security_host/path are configured if local-repo is defined --- content/templates/net-seed.tmpl | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index d2d9f872..d35ea061 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -24,35 +24,34 @@ d-i netcfg/get_domain string {{.Param "dns-domain"}} # Mirror Configuration d-i mirror/country string manual -{{if (eq "debian" .Env.OS.Family) -}} -d-i mirror/protocol string http -d-i mirror/http/hostname string http.us.debian.org -d-i mirror/http/directory string /debian -d-i apt-setup/security_host string security.debian.org -{{else -}} {{if .ParamExists "local-repo" -}} -{{if eq (.Param "local-repo") true}} +{{if eq (.Param "local-repo") true -}} d-i mirror/protocol string {{.ParseUrl "scheme" .Env.InstallUrl}} d-i mirror/http/hostname string {{.ParseUrl "host" .Env.InstallUrl}} d-i mirror/http/directory string {{.ParseUrl "path" .Env.InstallUrl}} {{else -}} +d-i mirror/protocol string http +{{if (eq "debian" .Env.OS.Family) -}} +d-i mirror/http/hostname string http.us.debian.org +d-i mirror/http/directory string /debian +{{else -}} d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/directory string /ubuntu -d-i apt-setup/security_host string archive.ubuntu.com -d-i apt-setup/security_path string /ubuntu {{end -}} +{{end -}} + +{{if (eq "debian" .Env.OS.Family) -}} +d-i apt-setup/security_host string security.debian.org {{else -}} -d-i mirror/http/hostname string archive.ubuntu.com -d-i mirror/http/directory string /ubuntu d-i apt-setup/security_host string archive.ubuntu.com d-i apt-setup/security_path string /ubuntu {{end -}} -{{end -}} -{{if .ParamExists "proxy-servers"}} + +{{if .ParamExists "proxy-servers" -}} d-i mirror/http/proxy string {{index (.Param "proxy-servers") 0}} -{{else}} +{{else -}} d-i mirror/http/proxy string -{{end}} +{{end -}} # Clock d-i clock-setup/utc boolean true From 2eda5989799652f5ea85332c9283731e04ee177f Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 31 Oct 2017 17:04:42 -0500 Subject: [PATCH 23/25] Fix local-repo for all the cases as well. --- content/templates/net-seed.tmpl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index d35ea061..7bb87304 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -34,18 +34,27 @@ d-i mirror/protocol string http {{if (eq "debian" .Env.OS.Family) -}} d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian +d-i apt-setup/security_host string security.debian.org {{else -}} d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/directory string /ubuntu +d-i apt-setup/security_host string archive.ubuntu.com +d-i apt-setup/security_path string /ubuntu {{end -}} {{end -}} - +{{else -}} +d-i mirror/protocol string http {{if (eq "debian" .Env.OS.Family) -}} +d-i mirror/http/hostname string http.us.debian.org +d-i mirror/http/directory string /debian d-i apt-setup/security_host string security.debian.org {{else -}} +d-i mirror/http/hostname string archive.ubuntu.com +d-i mirror/http/directory string /ubuntu d-i apt-setup/security_host string archive.ubuntu.com d-i apt-setup/security_path string /ubuntu {{end -}} +{{end -}} {{if .ParamExists "proxy-servers" -}} d-i mirror/http/proxy string {{index (.Param "proxy-servers") 0}} From ab3e7c24254ccc468b2ed5a1e38dd7673bf36695 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Wed, 1 Nov 2017 10:29:13 -0500 Subject: [PATCH 24/25] Add variable for local-security-repo to turn off the security repo if true. --- content/params/local-security-repo.yaml | 13 +++++++++++++ content/templates/net-seed.tmpl | 22 ++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 content/params/local-security-repo.yaml diff --git a/content/params/local-security-repo.yaml b/content/params/local-security-repo.yaml new file mode 100644 index 00000000..8be7f010 --- /dev/null +++ b/content/params/local-security-repo.yaml @@ -0,0 +1,13 @@ +--- +Name: "local-security-repo" +Description: "Indicates that the install should not specify a security repo" +Documentation: | + Boolean value that tells the install steps to not specify a security repo if true. + +Schema: + type: "boolean" + +Meta: + icon: "database" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index 7bb87304..eb70a119 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -34,12 +34,9 @@ d-i mirror/protocol string http {{if (eq "debian" .Env.OS.Family) -}} d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian -d-i apt-setup/security_host string security.debian.org {{else -}} d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/directory string /ubuntu -d-i apt-setup/security_host string archive.ubuntu.com -d-i apt-setup/security_path string /ubuntu {{end -}} {{end -}} {{else -}} @@ -47,10 +44,27 @@ d-i mirror/protocol string http {{if (eq "debian" .Env.OS.Family) -}} d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian -d-i apt-setup/security_host string security.debian.org {{else -}} d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/directory string /ubuntu +{{end -}} +{{end -}} + +{{if .ParamExists "local-security-repo" -}} +{{if eq (.Param "local-security-repo") true -}} +# Security repo not specified because of local-security-repo +{{else -}} +{{if (eq "debian" .Env.OS.Family) -}} +d-i apt-setup/security_host string security.debian.org +{{else -}} +d-i apt-setup/security_host string archive.ubuntu.com +d-i apt-setup/security_path string /ubuntu +{{end -}} +{{end -}} +{{else -}} +{{if (eq "debian" .Env.OS.Family) -}} +d-i apt-setup/security_host string security.debian.org +{{else -}} d-i apt-setup/security_host string archive.ubuntu.com d-i apt-setup/security_path string /ubuntu {{end -}} From 9642afb911299ca3ab59cf6c496d76dd7ac9bd80 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Wed, 1 Nov 2017 12:15:44 -0500 Subject: [PATCH 25/25] Make local-security-repo a string that allows for specific local repo specification. --- content/params/local-security-repo.yaml | 8 +++++--- content/templates/net-seed.tmpl | 16 +++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/content/params/local-security-repo.yaml b/content/params/local-security-repo.yaml index 8be7f010..7d5c93b8 100644 --- a/content/params/local-security-repo.yaml +++ b/content/params/local-security-repo.yaml @@ -1,11 +1,13 @@ --- Name: "local-security-repo" -Description: "Indicates that the install should not specify a security repo" +Description: "Specifies the security repo to use for Debian/Ubuntu OSes" Documentation: | - Boolean value that tells the install steps to not specify a security repo if true. + The string value is either a URL for Ubuntu systems or a host/path string + for Debian systems. This will override the default security repos if + specified. Schema: - type: "boolean" + type: "string" Meta: icon: "database" diff --git a/content/templates/net-seed.tmpl b/content/templates/net-seed.tmpl index eb70a119..5f399a81 100644 --- a/content/templates/net-seed.tmpl +++ b/content/templates/net-seed.tmpl @@ -51,17 +51,17 @@ d-i mirror/http/directory string /ubuntu {{end -}} {{if .ParamExists "local-security-repo" -}} -{{if eq (.Param "local-security-repo") true -}} -# Security repo not specified because of local-security-repo -{{else -}} {{if (eq "debian" .Env.OS.Family) -}} -d-i apt-setup/security_host string security.debian.org +d-i apt-setup/security_host string {{.Param "local-security-repo"}} {{else -}} -d-i apt-setup/security_host string archive.ubuntu.com -d-i apt-setup/security_path string /ubuntu -{{end -}} +d-i apt-setup/security_host string {{.ParseUrl "host" (.Param "local-security-repo")}} +d-i apt-setup/security_path string {{.ParseUrl "path" (.Param "local-security-repo")}} {{end -}} {{else -}} +{{if .ParamExists "local-repo" -}} +{{if eq (.Param "local-repo") true -}} +# Using local-repo and !local-security-repo - no security repo specified +{{else -}} {{if (eq "debian" .Env.OS.Family) -}} d-i apt-setup/security_host string security.debian.org {{else -}} @@ -69,6 +69,8 @@ d-i apt-setup/security_host string archive.ubuntu.com d-i apt-setup/security_path string /ubuntu {{end -}} {{end -}} +{{end -}} +{{end -}} {{if .ParamExists "proxy-servers" -}} d-i mirror/http/proxy string {{index (.Param "proxy-servers") 0}}