Skip to content

Scripts#

Usage of the scripts located in the scripts/ directory.

create_skeleton.sh#

Creates a new project skeleton with the necessary directories and files. It initializes a new git repository, creates the docs, state, and target directories, and populates the project with a basic Makefile, pyproject.toml, README.md, __main__.py, Pulumi.yaml, config-template.yaml, .gitignore, and mkdocs.yml.

Usage:

./scripts/create_skeleton.sh --yes [--project-dir dirname] [--name-library dirname]
  • --yes: Confirms the execution of the script.
  • --project-dir dirname: Specifies the project directory. Defaults to ../../.
  • --name-library dirname: Specifies the name of the shared infrastructure directory. Defaults to infra.

dnssec_gen.sh#

Generates DNSSEC KSK private and public keys (Anchor Data) and outputs them to STDOUT as JSON.

Usage:

./scripts/dnssec_gen.sh --zone name
  • --zone name: The name of the zone to generate keys for.

from_git.sh#

Clone and update a git repository. It can also be used to bootstrap a new system by creating a new user, installing the necessary packages, and setting up the git repository.

Usage:

Bootstrap:

./scripts/from_git.sh bootstrap --url <giturl> --branch <branch> \
    --user <user> --home <homedir> --git-dir <gitdir> \
    [--export-dir <targetdir>] [--revision-dir <revisiondir>] \
    [--keys-from-stdin | --keys-from-file <filename>]

Pull:

./scripts/from_git.sh pull --url <giturl> --branch <branch> \
    --user <user> --git-dir <gitdir> \
    [--export-dir <targetdir>] [--revision-dir <revisiondir>]

port_forward.py#

Requests a port forwarding so that a serve-port is reachable on a public-port.

Usage:

./scripts/port_forward.py \
    [--yaml-from-stdin] [--serve-port <port>] [--public-port <port>] \
    [--gateway-ip <ip>] [--protocol <protocol>] [--lifetime-sec <seconds>] \
    [--yaml-to-stdout] [--silent] \
    [--get-host-ip] [--get-gateway-ip] [--get-public-ip]

provision_shell.sh#

Start a shell inside the provisioning container.

Usage:

./scripts/provision_shell.sh [command]
  • command: The command to run inside the container. Defaults to /usr/bin/bash.

requirements.sh#

Checks and install the necessary packages for the project.

Usage:

./scripts/requirements.sh
    --install [--dry-run] | \
    --install-extra [--user] [--dry-run] | \
    --check [--verbose] | \
    --list | \
    --containerfile

salt-call.py#

A wrapper for the salt-call command. It includes monkeypatches for Python > 3.10 and > 3.12.

Usage:

It is intended to be used in the same way as the salt-call command.

serve_once.py#

Serves a file once over HTTPS. It uses STDIN for YAML configuration and payload to configure the service.

Usage:

<yaml-from-STDIN> | \
    ./scripts/serve_once.py [--verbose] --yes | \
    [<request_body-to-STDOUT>]

shell_inside_sim.sh#

Starts a shell inside a running libvirt simulation.

Usage:

./scripts/shell_inside_sim.sh

vault_pipe.sh#

Use vault to create a root CA and two provision CAs. It takes a JSON configuration file from STDIN and outputs a JSON file with the generated certificates and keys to STDOUT.

Usage:

<json-from-stdin> | ./scripts/vault_pipe.sh --yes | <json-to-stdout>

write_removable.py#

Writes an image to a removable storage device. It uses the serial number of the device to identify it.

Usage:

./scripts/write_removable.py --dest-serial <serial> [--dest-size <size>] \
    --source-image <image> [--patch <source> <dest_on_partition>] \
    [--list] [--verbose | --silent]