### Example URLs for Rendering OS Installation Files Source: https://github.com/digitalrebar/provision/blob/v4/doc/kb/kb-00031.rst Provides example URLs for accessing rendered Kickstart and Preseed files based on the operating system distribution. These URLs are used to fetch the dynamically generated installation configuration for a given machine. ```url http://10.10.10.10:8091/machines/7f65279a-7e5c-4e69-af40-dd01af4c5667/seed ``` ```url http://10.10.10.10:8091/machines/7f65279a-7e5c-4e69-af40-dd01af4c5667/compute.ks ``` -------------------------------- ### Install VMware Plugin and List ESXi Bootenvs Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst Installs the latest stable version of the VMware plugin and lists available ESXi boot environments. This command requires access to the DRP endpoint. ```bash drpcli catalog item install vmware drpcli bootenvs list|jq ''.[].Name|grep esxi ``` -------------------------------- ### Example Package Repository Configuration for Debian 9 Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst A commented example of a 'package-repositories' parameter for Debian 9 (stretch). This configuration specifies an installation source URL and details for the Debian repository structure. ```yaml - tag: "debian-9-install" os: - "debian-9" installSource: true url: "http://mirrors.kernel.org/debian" distribution: stretch components: - main ``` -------------------------------- ### Example Package Repository Configuration for CentOS 7 Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst A commented example of a 'package-repositories' parameter for CentOS 7. This configuration specifies an installation source URL and a general repository URL with multiple components. ```yaml - tag: "centos-7-install" os: - "centos-7" installSource: true url: "http://mirrors.kernel.org/centos/7/os/x86_64" - tag: "centos-7-everything" os: - centos-7 url: "http://mirrors.kernel.org/centos" distribution: "7" components: - atomic - centosplus - configmanagement - cr - dotnet - extras - fasttrack - os - rt - sclo - updates ``` -------------------------------- ### Windows Single Disk Partitioning Example (YAML) Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/imagedeploy-storage.rst This YAML configuration demonstrates a single disk setup for Windows, creating a 139GB C: drive using MSDOS partition format. It includes disk definition, partition creation, NTFS formatting, and mounting the root filesystem. ```yaml storage: version: 1 config: - id: disk0 type: disk ptable: msdos path: /dev/sda name: main_disk wipe: superblock - id: disk0-part1 type: partition number: 1 device: disk0 size: 139G flag: boot - id: disk0-part1-format-root type: format fstype: ntfs quiet: True volume: disk0-part1 - id: disk0-part1-mount-root type: mount path: / device: disk0-part1-format-root ``` -------------------------------- ### Linux Single Disk LVM Partitioning Example (YAML) Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/imagedeploy-storage.rst This YAML configuration illustrates a Linux LVM setup on a single disk with separate partitions for root, boot, var, and swap. It uses GPT partition table, creates LVM logical volumes, formats them with XFS, and mounts them to their respective directories. ```yaml storage: version: 1 config: - id: sda type: disk ptable: gpt path: /dev/sda name: main_disk grub_device: true - id: bios_boot_partition type: partition size: 1MB device: sda flag: bios_grub - id: boot_part name: boot_part type: partition size: 8GB device: sda flag: boot - id: lvm_part type: partition size: 40G device: sda - id: volgroup1 name: volgroup1 type: lvm_volgroup devices: - lvm_part - id: root_part name: root_part size: 10G type: lvm_partition volgroup: volgroup1 - id: swap_part name: swap_part type: lvm_partition volgroup: volgroup1 size: 4G - id: var_part name: var_part type: lvm_partition volgroup: volgroup1 - id: boot_fs type: format fstype: xfs volume: boot_part - id: root_fs name: storage type: format fstype: xfs volume: root_part - id: var_fs name: storage type: format fstype: xfs volume: var_part - id: swap_fs name: storage type: format fstype: swap volume: swap_part - id: root_mount type: mount path: / device: root_fs - id: boot_mount type: mount path: /boot device: boot_fs - id: var_mount type: mount path: /var device: var_fs - id: swap_mount type: mount path: swap device: swap_fs ``` -------------------------------- ### drpcli Self-Documentation Examples Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/drpcli.rst Demonstrates how to use the drpcli tool to get contextual help for different resource levels. This is useful for exploring available commands and their parameters. ```bash drpcli drpcli templates drpcli templates create ``` -------------------------------- ### DRPCLI Binary Linking Example Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/drpcli.rst Demonstrates how to create symbolic links for the drpcli and dr-provision binaries to make them accessible in the system's PATH. This is useful for isolated install modes. ```bash ln -s $HOME/bin/linux/amd64/dr-provision $HOME/bin/ ln -s $HOME/bin/linux/amd64/drpcli $HOME/bin/ ``` -------------------------------- ### Start Universal Linux Install Workflow via drpcli Source: https://github.com/digitalrebar/provision/blob/v4/doc/kb/kb-00061.rst Initiates the 'universal-linux-install' workflow for a specified machine using the drpcli command-line tool. This command requires the machine's name or UUID. It's a direct method for triggering automated OS installations. ```bash # you can select machines by Name:[NAME] or replace it with the Machines UUID value drpcli machines workflow Name:mach-01.example.org universal-linux-install ``` -------------------------------- ### Minimal ESXi Profile Configuration Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst A minimal JSON configuration for an ESXi profile, including settings for disk installation, serial console, and shell access. This profile is intended for cloning and customization. ```json { "Name": "esxi-profile-clone", "Description": "(clone) Sample profile settings for ESXi kickstart install.", "Documentation": "Sets some basic Param values that are useful for dev/test deployments\nof VMware vSphere ESXi hypervisors. Generally speaking these aren't\ngood to set for production systems.\n\nThis profile is intended to be cloned and applied to a Machine(s) for\nsubsequent use. You can then remove/modify the values appropriate to\nyour use case, after you nave cloned it.\n", "Meta": { "color": "blue", "icon": "world", "title": "RackN Content" }, "Params": { "esxi/disk-install-options": "--firstdisk --overwritevmfs", "esxi/serial-console": "gdbPort=none logPort=none tty2Port=com1", "esxi/shell-local": true, "esxi/shell-remote": true, } } ``` -------------------------------- ### Golang Template for Dynamic Boot File Selection (DHCP Option 67) Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst This example demonstrates using Golang template expansion within the Next Boot File option (67) to dynamically select a boot image based on machine capabilities. It checks for iPXE support and UEFI compatibility to serve the appropriate bootloader. ```go-template {{if (eq (index . 77) "iPXE") }}default.ipxe{{else if (eq (index . 93) "0")}}ipxe.pxe{{else}}ipxe.efi{{end}} ``` -------------------------------- ### Configure Web Proxy with web-proxy.tmpl Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst This sub-template configures environment variables and apt repositories to use a web proxy. It utilizes the 'proxy-servers' parameter and should be placed in the post-install section of kickstart or net-post-install.sh scripts. ```jinja2 {{ template "web-proxy.tmpl" . }} ``` -------------------------------- ### Install Digital Rebar Endpoint (Bash) Source: https://github.com/digitalrebar/provision/blob/v4/doc/quickstart.rst Installs the stable version of Digital Rebar Provision using a curl script. This command downloads the DRP, necessary content bundles for Universal workflows, verifies prerequisites, and sets up directories. The '--universal' flag must be the first argument after 'install'. ```bash curl -fsSL get.rebar.digital/stable | bash -s -- install --universal ``` -------------------------------- ### Create ESXi Profile Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst Creates a new ESXi profile by cloning an existing one and customizing its parameters. The profile is then uploaded to the DRP endpoint. ```bash drpcli profiles show esxi-profile > esxi-profile-clone.json $EDITOR esxi-profile-clone.json drpcli profiles create esxi-profile-clone.json ``` -------------------------------- ### Create and Configure Example Machine for Workflow Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/contexts.rst Creates an empty machine named 'example', then updates its workflow to 'context-demo' and sets its context to 'runner'. This triggers the workflow and demonstrates the context runner functionality. ```bash drpcli machines create example drpcli machines update Name:example '{"Workflow":"context-demo"}' drpcli machines update Name:example '{"Context":"runner"}' ``` -------------------------------- ### Remove Uploaded ESXi ISO Image Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst Removes the previously uploaded ESXi ISO image from the local filesystem on the DRP endpoint. This is a cleanup step after successful upload. ```bash rm /root/VMware-VMvisor-Installer-7.0.0-15843807.x86_64.iso rm /root/VMware-VMvisor-Installer-7.0.0-15843807.x86_64-DellEMC_Customized-A00.iso ``` -------------------------------- ### Create Virtual Machine using virt-install Source: https://github.com/digitalrebar/provision/blob/v4/doc/setup/kvm.rst This example demonstrates how to create a virtual machine using the virt-install command-line tool. It specifies machine resources, operating system, disk image, network configuration for PXE boot, and VNC graphics. The output machine name in Digital Rebar will be based on the PXE boot MAC address. ```bash virt-install \ --name=winders --ram=4096 --cpu host --hvm --vcpus=2 \ --os-type=windows --os-variant=win10 \ --disk /var/lib/libvirt/images/winders.qcow2,size=80,bus=virtio \ --pxe --network bridge=kvm-test,model=virtio \ --graphics vnc,listen=127.0.0.1,password=foobar --check all=off & ``` -------------------------------- ### Expand Repositories for OS Installation (Go Template) Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst This Go template code iterates through the available installation repositories and formats them for inclusion in an unattended OS installation file. It utilizes the `.InstallRepos` and `.Install` properties of the Repo object. ```go-template {{range $repo := .InstallRepos}}{{$repo.Install}}{{end}} ``` -------------------------------- ### Upload ESXi ISO Image Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst Uploads the ESXi ISO image to the Digital Rebar Provision endpoint. The ISO filename must exactly match the BootEnv's expected filename. ```bash drpcli isos upload VMware-VMvisor-Installer-7.0.0-15843807.x86_64-DellEMC_Customized-A00.iso ``` ```bash drpcli isos upload VMware-VMvisor-Installer-7.0.0-15843807.x86_64.iso ``` -------------------------------- ### Apply ESXi Profile and Workflow to Machine using drpcli Source: https://github.com/digitalrebar/provision/blob/v4/doc/operations/esxi-getting-started.rst This command applies a cloned ESXi profile named 'esxi-profile-clone' and sets the 'esxi-install' workflow for a machine identified as 'esxi-7-test'. It assumes the machine is already discovered and in a waiting state. ```bash drpcli machines update Name:esxi-7-test '{"Profiles": ["esxi-profile-clone"], "Workflow": "esxi-install"}' ``` -------------------------------- ### drpcli Basic Command Examples Source: https://github.com/digitalrebar/provision/blob/v4/doc/cli.rst Demonstrates basic usage of the drpcli for common operations. These examples show how to list boot environments, retrieve specific subnets, and set preferences. ```bash drpcli bootenvs list drpcli subnets get mysubnet drpcli preferences set defaultBootEnv discovery ``` -------------------------------- ### Upload Operating System Boot Environments Source: https://github.com/digitalrebar/provision/blob/v4/doc/quickstart.rst Uploads ISO images for popular operating systems to Digital Rebar, making them available for network booting and installation. These commands fetch the ISO from the internet and upload it. Alternatively, pre-downloaded ISOs can be uploaded using `drpcli isos upload`. ```bash drpcli bootenvs uploadiso ubuntu-20.04-install drpcli bootenvs uploadiso centos-8-install ``` -------------------------------- ### Environment and OS Information Helpers in Digital Rebar Provision Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/provision.rst These helpers provide information about the current rendering environment and the operating system. .Env.PathFor constructs client-side paths, .Env.JoinInitrds combines initrds for a given proto. .BootParams returns rendered boot parameters. OS family, version, and type can be derived from .Env.OS. ```go-template {{ .Env.PathFor "http" "/path/to/resource" }} {{ .Env.JoinInitrds "tftp" }} {{ .BootParams }} {{ .Env.OS.FamilyName }} {{ .Env.OS.FamilyVersion }} {{ .Env.OS.FamilyType }} {{ .Env.OS.VersionEq "10.0" }} ``` -------------------------------- ### Referencing Boot Environment Files in Digital Rebar Provision Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst Shows how to construct URLs for accessing files within the boot environment's exploded ISO space using TFTP or HTTP protocols. This is crucial for fetching boot files and installation media. ```go-template {{ .Env.PathFor "tftp" "path/to/file" }} {{ .Env.PathFor "http" "path/to/file" }} ``` -------------------------------- ### Get Install Script Help Source: https://github.com/digitalrebar/provision/blob/v4/doc/install/upgrade.rst This command displays the help information for the `install.sh` script, which is used for isolated mode installations of dr-provision. Running this command provides details on available flags and options for the installation process. ```bash install.sh --help ``` -------------------------------- ### Example Profile for Setting Next Boot Environment Source: https://github.com/digitalrebar/provision/blob/v4/doc/arch/data.rst An example of a Digital Rebar Provision profile that sets the next BootEnv for a machine. This is typically configured within the machine's parameters. ```yaml Name: post-install-bootenv Params: next_boot_env: cores-live ``` -------------------------------- ### Create and List Boot Environments in Go Source: https://context7.com/digitalrebar/provision/llms.txt Demonstrates how to create a new boot environment for CentOS 8 using the DigitalRebar Provision API. It also shows how to list all available boot environments. Requires the digitalrebar/provision/v4/api and models packages. ```go package main import ( "fmt" "log" "github.com/digitalrebar/provision/v4/api" "github.com/digitalrebar/provision/v4/models" ) func main() { client, _ := api.UserSession("https://drp:8092", "rocketskates", "r0cketsk8ts") defer client.Close() // Create a boot environment for CentOS 8 bootenv := &models.BootEnv{ Name: "centos-8-install", Description: "CentOS 8 installation environment", OS: models.OsInfo{ Name: "centos-8", Family: "centos", Version: "8", IsoFile: "CentOS-8.4.2105-x86_64-dvd1.iso", IsoSha256: "aaf9d4b3071c16dbbda01dfe06085e5d0fdac76df323e3b..." IsoUrl: "https://mirrors.example.com/centos/8/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso", SupportedArchitectures: map[string]models.ArchInfo{ "amd64": { Kernel: "images/pxeboot/vmlinuz", Initrds: []string{"images/pxeboot/initrd.img"}, BootParams: "inst.ks={{.Machine.Url}}/compute.ks", }, "arm64": { Kernel: "images/pxeboot/vmlinuz", Initrds: []string{"images/pxeboot/initrd.img"}, IsoFile: "CentOS-8.4.2105-aarch64-dvd1.iso", }, }, }, Kernel: "images/pxeboot/vmlinuz", Initrds: []string{"images/pxeboot/initrd.img"}, BootParams: "inst.stage2={{.Env.InstallUrl}} inst.ks={{.Machine.Url}}/compute.ks", RequiredParams: []string{"operating-system-disk"}, OptionalParams: []string{"proxy-servers", "ntp-servers"}, Templates: []models.TemplateInfo{ {Name: "pxelinux", Path: "pxelinux.cfg/{{.Machine.HexAddress}}", ID: "pxelinux.tmpl"}, {Name: "kickstart", Path: "{{.Machine.Path}}/compute.ks", ID: "centos-ks.tmpl"}, }, } if err := client.CreateModel(bootenv); err != nil { log.Fatalf("Failed to create bootenv: %v", err) } fmt.Printf("Created bootenv: %s\n", bootenv.Name) // List available boot environments envs, _ := client.ListModel("bootenvs") for _, e := range envs { env := e.(*models.BootEnv) fmt.Printf(" %s: NetBoot=%v, OnlyUnknown=%v\n", env.Name, env.NetBoot(), env.OnlyUnknown) } } ``` -------------------------------- ### Install kvm-test Plugin Provider Source: https://github.com/digitalrebar/provision/blob/v4/doc/setup/kvm.rst Installs the 'kvm-test' Plugin Provider for Digital Rebar, enabling KVM-specific functionalities. This can be done via the UX Catalog or the drpcli command. ```bash drpcli catalog item install kvm-test ``` -------------------------------- ### Start dr-provision Service with systemd Source: https://github.com/digitalrebar/provision/blob/v4/doc/install/upgrade.rst These commands demonstrate how to start and check the status of the dr-provision service when installed in production mode using systemd. This is the standard method for managing the service on most Linux distributions. ```bash systemctl start dr-provision systemctl status dr-provision ``` -------------------------------- ### DRP Binary Help for Certificates Source: https://github.com/digitalrebar/provision/blob/v4/doc/kb/kb-00059.rst This command displays the help information for the 'dr-provision' binary, focusing on options related to certificates and keys. This is useful for understanding how to configure DRP to use generated certificates and keys in various operational modes. Review the output for detailed parameter explanations. ```bash dr-provision --help ``` -------------------------------- ### Install KVM Packages Source: https://github.com/digitalrebar/provision/blob/v4/doc/setup/kvm.rst Installs necessary packages for KVM and libvirt virtualization, including qemu-kvm, libvirt, and related tools. This command assumes a CentOS/RHEL-based system using yum. ```bash yum makecache yum install qemu-kvm libvirt libvirt-python libguestfs-tools bridge-utils iptables iptables-services util-linux unbound curl wget jq ```