Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from digitalrebar/content-reorg
Browse files Browse the repository at this point in the history
Content reorg
  • Loading branch information
galthaus authored Nov 1, 2017
2 parents b0c42db + 9642afb commit f197130
Show file tree
Hide file tree
Showing 79 changed files with 1,263 additions and 143 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
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
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ branches:
- gh-pages
sudo: false
go:
- 1.8
- 1.9
git:
depth: 500
addons:
apt:
packages:
- sshpass
- bsdtar
- p7zip-full
script:
- mkdir -p ~/.ssh
- cp tools/ssh-config ~/.ssh/config
Expand All @@ -29,6 +29,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
Expand Down
23 changes: 23 additions & 0 deletions TRAVIS_BUILD_NOTES
Original file line number Diff line number Diff line change
@@ -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.

1 change: 1 addition & 0 deletions content/._Description.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Digital Rebar Provision Community Content
1 change: 1 addition & 0 deletions content/._Name.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drp-community-content
1 change: 1 addition & 0 deletions content/._Source.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/digitalrebar/provision-content
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Name: "ce-centos-7.4.1708-install"
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"
Expand All @@ -8,23 +9,29 @@ 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: "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"
37 changes: 37 additions & 0 deletions content/bootenvs/centos-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
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"
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"
- "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"
19 changes: 12 additions & 7 deletions bootenvs/ce-debian-8.yml → content/bootenvs/debian-8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Name: "ce-debian-8-install"
Name: "debian-8-install"
Description: "Debian 8 install BootEnv"
OS:
Name: "debian-8"
Family: "debian"
Expand Down Expand Up @@ -39,21 +40,25 @@ 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: "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"
19 changes: 12 additions & 7 deletions bootenvs/ce-debian-9.yml → content/bootenvs/debian-9.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Name: "ce-debian-9-install"
Name: "debian-9-install"
Description: "Debian 9 install BootEnv"
OS:
Name: "debian-9"
Family: "debian"
Expand Down Expand Up @@ -39,21 +40,25 @@ 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: "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"
31 changes: 26 additions & 5 deletions bootenvs/ce-discovery.yml → content/bootenvs/discovery.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Name: "ce-discovery"
Description: "The boot environment to use to have unknown machines boot to Sledgehammer"
Name: "discovery"
Description: "The boot environment to use to have unknown machines boot to default Stage/BootEnv"
OnlyUnknown: true
OS:
Name: "sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15"
Expand All @@ -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"
Expand Down Expand Up @@ -64,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":"([^ ]+)"'
Expand All @@ -78,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
Expand Down Expand Up @@ -109,8 +131,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
Expand Down
28 changes: 20 additions & 8 deletions bootenvs/ce-sledgehammer.yml → content/bootenvs/sledgehammer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@
# 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"
Description: "Ram-Only image loaded with tools to allow for discovery and maintenance"
OS:
Name: "sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15"
IsoFile: "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar"
IsoUrl: "http://rackn-sledgehammer.s3-website-us-west-2.amazonaws.com/sledgehammer/f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15/sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar"
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"
Expand Down Expand Up @@ -72,12 +85,11 @@ Templates:
export PS4="${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): "
cp /usr/share/zoneinfo/GMT /etc/localtime
{{template "ce-root-remote-access.tmpl" .}}
# This will contain a token appropriate for the path being
# used below. Reset the token to the longer machine token.
export RS_TOKEN="{{.GenerateToken}}"
# 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
Loading

0 comments on commit f197130

Please sign in to comment.