diff --git a/.gitignore b/.gitignore index f4bd0fb8..d5a608a7 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.travis.yml b/.travis.yml index c9fd39db..0ae07816 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 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. + 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/bootenvs/ce-centos-7.4.1708.yml b/content/bootenvs/centos-7.4.1708.yml similarity index 63% rename from bootenvs/ce-centos-7.4.1708.yml rename to content/bootenvs/centos-7.4.1708.yml index 6ce344a7..0297a217 100644 --- a/bootenvs/ce-centos-7.4.1708.yml +++ b/content/bootenvs/centos-7.4.1708.yml @@ -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" @@ -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" diff --git a/content/bootenvs/centos-7.yml b/content/bootenvs/centos-7.yml new file mode 100644 index 00000000..43575623 --- /dev/null +++ b/content/bootenvs/centos-7.yml @@ -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" diff --git a/bootenvs/ce-debian-8.yml b/content/bootenvs/debian-8.yml similarity index 83% rename from bootenvs/ce-debian-8.yml rename to content/bootenvs/debian-8.yml index c4297866..08190de5 100644 --- a/bootenvs/ce-debian-8.yml +++ b/content/bootenvs/debian-8.yml @@ -1,5 +1,6 @@ --- -Name: "ce-debian-8-install" +Name: "debian-8-install" +Description: "Debian 8 install BootEnv" OS: Name: "debian-8" Family: "debian" @@ -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" diff --git a/bootenvs/ce-debian-9.yml b/content/bootenvs/debian-9.yml similarity index 83% rename from bootenvs/ce-debian-9.yml rename to content/bootenvs/debian-9.yml index dbcccb1e..a5f97a6d 100644 --- a/bootenvs/ce-debian-9.yml +++ b/content/bootenvs/debian-9.yml @@ -1,5 +1,6 @@ --- -Name: "ce-debian-9-install" +Name: "debian-9-install" +Description: "Debian 9 install BootEnv" OS: Name: "debian-9" Family: "debian" @@ -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" diff --git a/bootenvs/ce-discovery.yml b/content/bootenvs/discovery.yml similarity index 88% rename from bootenvs/ce-discovery.yml rename to content/bootenvs/discovery.yml index cb1ef370..07761f69 100644 --- a/bootenvs/ce-discovery.yml +++ b/content/bootenvs/discovery.yml @@ -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" @@ -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" @@ -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":"([^ ]+)"' @@ -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 @@ -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 diff --git a/bootenvs/ce-sledgehammer.yml b/content/bootenvs/sledgehammer.yml similarity index 80% rename from bootenvs/ce-sledgehammer.yml rename to content/bootenvs/sledgehammer.yml index c3464d59..e6d2b842 100644 --- a/bootenvs/ce-sledgehammer.yml +++ b/content/bootenvs/sledgehammer.yml @@ -2,7 +2,8 @@ # 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" @@ -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" @@ -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 diff --git a/bootenvs/ce-ubuntu-16.04.yml b/content/bootenvs/ubuntu-16.04.yml similarity index 51% rename from bootenvs/ce-ubuntu-16.04.yml rename to content/bootenvs/ubuntu-16.04.yml index ee43256a..673e241d 100644 --- a/bootenvs/ce-ubuntu-16.04.yml +++ b/content/bootenvs/ubuntu-16.04.yml @@ -1,5 +1,6 @@ --- -Name: "ce-ubuntu-16.04-install" +Name: "ubuntu-16.04-install" +Description: "Ubuntu-16.04 install points to the latest release version" OS: Name: "ubuntu-16.04" Family: "ubuntu" @@ -10,31 +11,47 @@ 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" + - "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" diff --git a/content/params/access-keys.yaml b/content/params/access-keys.yaml new file mode 100644 index 00000000..c84366d3 --- /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: "Digital Rebar Community Content" diff --git a/content/params/access-ssh-root-mode.yaml b/content/params/access-ssh-root-mode.yaml new file mode 100644 index 00000000..0672a888 --- /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: "Digital Rebar Community Content" diff --git a/content/params/change-stage.map.yaml b/content/params/change-stage.map.yaml new file mode 100644 index 00000000..e0fd1e23 --- /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: "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 new file mode 100644 index 00000000..9be07abd --- /dev/null +++ b/content/params/gohai-inventory.yaml @@ -0,0 +1,11 @@ +--- +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: "Digital Rebar Community Content" diff --git a/content/params/kernel-console.yaml b/content/params/kernel-console.yaml new file mode 100644 index 00000000..3edad131 --- /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: "Digital Rebar Community Content" diff --git a/content/params/local-repo.yaml b/content/params/local-repo.yaml new file mode 100644 index 00000000..809f6501 --- /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: "database" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/params/local-security-repo.yaml b/content/params/local-security-repo.yaml new file mode 100644 index 00000000..7d5c93b8 --- /dev/null +++ b/content/params/local-security-repo.yaml @@ -0,0 +1,15 @@ +--- +Name: "local-security-repo" +Description: "Specifies the security repo to use for Debian/Ubuntu OSes" +Documentation: | + 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: "string" + +Meta: + icon: "database" + 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/profiles/ce-root-access.yml b/content/profiles/root-access-example.yml similarity index 79% rename from profiles/ce-root-access.yml rename to content/profiles/root-access-example.yml index 8ed433ec..21e7a4d8 100644 --- a/profiles/ce-root-access.yml +++ b/content/profiles/root-access-example.yml @@ -1,8 +1,12 @@ -Name: ce-root-access +--- +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 # 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" diff --git a/content/stages/centos-7.4.1708.yml b/content/stages/centos-7.4.1708.yml new file mode 100644 index 00000000..97627d9b --- /dev/null +++ b/content/stages/centos-7.4.1708.yml @@ -0,0 +1,14 @@ +--- +Name: "centos-7.4.1708-install" +Description: "CentOS 7.4.1708 install stage." +BootEnv: "centos-7.4.1708-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/centos-7.yml b/content/stages/centos-7.yml new file mode 100644 index 00000000..4f1e9d9c --- /dev/null +++ b/content/stages/centos-7.yml @@ -0,0 +1,14 @@ +--- +Name: "centos-7-install" +Description: "CentOS 7 install stages. References the latest CentOS 7 release" +BootEnv: "centos-7-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/complete-nowait.yaml b/content/stages/complete-nowait.yaml new file mode 100644 index 00000000..46e0af4f --- /dev/null +++ b/content/stages/complete-nowait.yaml @@ -0,0 +1,8 @@ +--- +Name: "complete-nowait" +Description: "Stage that represents workflow completion to local disk. Does NOT change stages" +BootEnv: "local" +Meta: + icon: "checkmark" + color: "green" + title: "Digital Rebar Community Content" diff --git a/content/stages/complete.yml b/content/stages/complete.yml new file mode 100644 index 00000000..ea6a645b --- /dev/null +++ b/content/stages/complete.yml @@ -0,0 +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: "Digital Rebar Community Content" diff --git a/content/stages/debian-8.yml b/content/stages/debian-8.yml new file mode 100644 index 00000000..fcbc74dc --- /dev/null +++ b/content/stages/debian-8.yml @@ -0,0 +1,13 @@ +--- +Name: "debian-8-install" +Description: "Debian 8 install stage. References latest debian 8 install image." +BootEnv: "debian-8-install" +RunnerWait: true +Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/debian-9.yml b/content/stages/debian-9.yml new file mode 100644 index 00000000..d0c7c242 --- /dev/null +++ b/content/stages/debian-9.yml @@ -0,0 +1,13 @@ +--- +Name: "debian-9-install" +Description: "Debian 9 install stage. References the latest Debian 9 image" +BootEnv: "debian-9-install" +RunnerWait: true +Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/discover.yaml b/content/stages/discover.yaml new file mode 100644 index 00000000..9d4b4a1c --- /dev/null +++ b/content/stages/discover.yaml @@ -0,0 +1,13 @@ +--- +Name: "discover" +Description: "Discovery stage used to inventory and baseline new machines" +BootEnv: "sledgehammer" +RunnerWait: true +Tasks: + - "gohai" + - "ssh-access" + - "change-stage" +Meta: + icon: "spinner" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/content/stages/finish-install.yaml b/content/stages/finish-install.yaml new file mode 100644 index 00000000..050094ec --- /dev/null +++ b/content/stages/finish-install.yaml @@ -0,0 +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: "Digital Rebar Community Content" diff --git a/content/stages/sledgehammer-wait.yaml b/content/stages/sledgehammer-wait.yaml new file mode 100644 index 00000000..85572ee0 --- /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: "Digital Rebar Community Content" diff --git a/content/stages/ssh-access.yaml b/content/stages/ssh-access.yaml new file mode 100644 index 00000000..9a373b0c --- /dev/null +++ b/content/stages/ssh-access.yaml @@ -0,0 +1,11 @@ +--- +Name: "ssh-access" +Description: "Stage that installs SSH keys and configure SSH access policy" +RunnerWait: true +Tasks: + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..34e70a56 --- /dev/null +++ b/content/stages/ubuntu-16.04.yml @@ -0,0 +1,13 @@ +--- +Name: "ubuntu-16.04-install" +Description: "Ubuntu 16.04 installation stage. References latest release" +BootEnv: "ubuntu-16.04-install" +RunnerWait: true +Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..fcdf8bfb --- /dev/null +++ b/content/tasks/centos-drp-only-repos.yaml @@ -0,0 +1,13 @@ +--- +Description: "A task to force the machine to switch to DRP hosted-only centos repos." +Name: "centos-drp-only-repos" +OptionalParams: + - "local-repo" +Templates: + - ID: "centos-drp-only-repos.sh.tmpl" + Name: "Force node to install from drp hosted repos" + Path: "" +Meta: + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/tasks/change-stage.yaml b/content/tasks/change-stage.yaml new file mode 100644 index 00000000..44d46f56 --- /dev/null +++ b/content/tasks/change-stage.yaml @@ -0,0 +1,14 @@ +--- +Description: "A task to change stages" +Name: "change-stage" +OptionalParams: +- "change-stage/map" +Templates: +- ID: "change-stage.sh.tmpl" + Name: "Change stage" + Path: "" +Meta: + 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 new file mode 100644 index 00000000..97c534b3 --- /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: "Digital Rebar Community 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..d5679f55 --- /dev/null +++ b/content/tasks/set-hostname.yaml @@ -0,0 +1,11 @@ +--- +Description: "A task to set the hostname" +Name: "set-hostname" +Templates: + - ID: "set-hostname.sh.tmpl" + Name: "Set the hostname on the machine" + Path: "" +Meta: + icon: "key" + color: "blue" + title: "Digital Rebar Community Content" diff --git a/content/tasks/ssh-access.yaml b/content/tasks/ssh-access.yaml new file mode 100644 index 00000000..b160d125 --- /dev/null +++ b/content/tasks/ssh-access.yaml @@ -0,0 +1,14 @@ +--- +Description: "A task to put root ssh keys in place" +Name: "ssh-access" +OptionalParams: + - "access-keys" + - "access-ssh-root-mode" +Templates: + - ID: "access-keys.sh.tmpl" + Name: "Put access keys in place for root user" + Path: "" +Meta: + 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 new file mode 100644 index 00000000..4b8a13c5 --- /dev/null +++ b/content/tasks/ubuntu-drp-only-repos.yaml @@ -0,0 +1,13 @@ +--- +Description: "A task to force the node to switch to DRP hosted-only ubuntu repos." +Name: "ubuntu-drp-only-repos" +OptionalParams: + - "local-repo" +Templates: + - ID: "ubuntu-drp-only-repos.sh.tmpl" + Name: "Force node to install from drp hosted repos" + Path: "" +Meta: + 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 new file mode 100644 index 00000000..abc7a2f8 --- /dev/null +++ b/content/templates/access-keys.sh.tmpl @@ -0,0 +1,52 @@ +#!/bin/bash +# +# This template populates the root's authorized keys file +# 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 access-keys is undefined +# +# Required Parameters: access-keys +# Optional Parameters: access-ssh-root-mode +# +# Parameter YAML format: +# +# access-keys: +# greg: ssh-rsa key +# greg2: ssh-rsa key +# access-ssh-root-mode: "without-password|yes|no|forced-commands-only" +# +# Defaults: +# 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/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..fcc4aab6 --- /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/._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/bootenvs/centos-6.9.yml b/contrib/bootenvs/centos-6.9.yml new file mode 100644 index 00000000..11fd1ae3 --- /dev/null +++ b/contrib/bootenvs/centos-6.9.yml @@ -0,0 +1,35 @@ +--- +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" + 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" +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "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-6.ks.tmpl" + Name: "compute.ks" + Path: "{{.Machine.Path}}/compute.ks" diff --git a/contrib/bootenvs/centos-6.yml b/contrib/bootenvs/centos-6.yml new file mode 100644 index 00000000..8b252c59 --- /dev/null +++ b/contrib/bootenvs/centos-6.yml @@ -0,0 +1,35 @@ +--- +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" + 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" +BootParams: >- + ksdevice=bootif + ks={{.Machine.Url}}/compute.ks + method={{.Env.InstallUrl}} + -- + {{ if .ParamExists "kernel-console"}}{{.Param "kernel-console" }}{{ end }} +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "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-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..0989e547 --- /dev/null +++ b/contrib/bootenvs/centos-7.3.1611.yml @@ -0,0 +1,36 @@ +--- +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" + 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}} +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "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/contrib/bootenvs/scientificlinux-6.8.yml b/contrib/bootenvs/scientificlinux-6.8.yml new file mode 100644 index 00000000..2488513c --- /dev/null +++ b/contrib/bootenvs/scientificlinux-6.8.yml @@ -0,0 +1,35 @@ +--- +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" + 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 }} +OptionalParams: + - "operating-system-disk" + - "provisioner-default-password-hash" + - "proxy-servers" + - "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-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..b5dbbd6d --- /dev/null +++ b/contrib/bootenvs/ubuntu-14.04.yml @@ -0,0 +1,56 @@ +--- +Name: "ubuntu-14.04-install" +Description: "Ubuntu 14.04 install bootenv that references latest release" +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 }} +OptionalParams: + - "part-scheme" + - "operating-system-disk" + - "provisioner-default-user" + - "provisioner-default-fullname" + - "provisioner-default-uid" + - "provisioner-default-password-hash" + - "kernel-console" + - "proxy-servers" + - "dns-domain" + - "local-repo" + - "proxy-servers" + - "ntp-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: "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.9.yml b/contrib/stages/centos-6.9.yml new file mode 100644 index 00000000..41b6539e --- /dev/null +++ b/contrib/stages/centos-6.9.yml @@ -0,0 +1,14 @@ +--- +Name: "centos-6.9-install" +Description: "CentOS 6.9 install stage" +BootEnv: "centos-6.9-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + icon: "download" + color: "yellow" + title: "Digital Rebar Community Content" diff --git a/contrib/stages/centos-6.yml b/contrib/stages/centos-6.yml new file mode 100644 index 00000000..00283c69 --- /dev/null +++ b/contrib/stages/centos-6.yml @@ -0,0 +1,14 @@ +--- +Name: "centos-6-install" +Description: "CentOS 6 install stage that references the latest version" +BootEnv: "centos-6-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..317ba3de --- /dev/null +++ b/contrib/stages/centos-7.3.1611.yml @@ -0,0 +1,14 @@ +--- +Name: "centos-7.3.1611-install" +Description: "CentOS 7.3.1611 install stage" +BootEnv: "centos-7.3.1611-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..ee997ce2 --- /dev/null +++ b/contrib/stages/scientificlinux-6.8.yml @@ -0,0 +1,14 @@ +--- +Name: "scientificlinux-6.8-install" +Description: "Scientific Linux 6.8 install stage" +BootEnv: "scientificlinux-6.8-install" +RunnerWait: true +Tasks: + - "set-hostname" + - "centos-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..bddf6198 --- /dev/null +++ b/contrib/stages/ubuntu-14.04.yml @@ -0,0 +1,13 @@ +--- +Name: "ubuntu-14.04-install" +Description: "Ubuntu 14.04 install stage that references latest release" +BootEnv: "ubuntu-14.04-install" +RunnerWait: true +Tasks: + - "ubuntu-drp-only-repos" + - "ssh-access" + - "change-stage" +Meta: + 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 new file mode 100644 index 00000000..da0f97a5 --- /dev/null +++ b/contrib/templates/centos-6.ks.tmpl @@ -0,0 +1,56 @@ +# 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}}"{{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]}): ' + +RUNNER_WAIT=false +{{ template "runner.tmpl" . }} + +sync +%end diff --git a/templates/ce-root-remote-access.tmpl b/templates/ce-root-remote-access.tmpl deleted file mode 100644 index c924154a..00000000 --- a/templates/ce-root-remote-access.tmpl +++ /dev/null @@ -1,33 +0,0 @@ -# -# This template populates the root's authorized keys file -# 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 -# -# Required Parameters: access-keys -# Optional Parameters: access-ssh-root-mode -# -# Parameter YAML format: -# -# access-keys: -# greg: ssh-rsa key -# greg2: ssh-rsa key -# access-ssh-root-mode: "without-password|yes|no|forced-commands-only" -# -# Defaults: -# access-keys - empty -# access-ssh-root-mode - defaults to "without-password" if unspecified -# -{{if .ParamExists "access-keys"}} -mkdir -p /root/.ssh -cat >/root/.ssh/authorized_keys <> /etc/ssh/sshd_config -echo "AcceptEnv http_proxy https_proxy no_proxy" >> /etc/ssh/sshd_config -{{end}} diff --git a/templates/ce-update-drp-local.tmpl b/templates/ce-update-drp-local.tmpl deleted file mode 100644 index 64a69542..00000000 --- a/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/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 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