Skip to content

::once

once is a BigConfig package for ONCE. This BigConfig package is an infrastructure automation tool that simplifies the provisioning and configuration of cloud resources using OpenTofu and Ansible.

It is built on top of big-config, leveraging its workflow and configuration management capabilities.

  • Workflow Orchestration: Orchestrate complex multi-step processes like tofu init/apply followed by ansible-playbook executions.
  • Hyperscaler Support: Supports infrastructure provisioning on:
    • Hetzner Cloud (hcloud)
    • Oracle Cloud Infrastructure (oci)
  • Configurable Workflows:
    • create: Provisions infrastructure using Tofu and then configures it using Ansible (both remote and local).
    • delete: Tears down infrastructure using Tofu.
  • Dynamic Inventory: Automatically generates Ansible inventory from OpenTofu outputs.

To use package once, you need the following tools installed:

once can be used via Babashka tasks or as a Clojure library.

If you have bb installed, you can use the following tasks:

  • Clone the package:
    Terminal window
    git clone https://github.com/amiorin/once
  • Edit the options of the package:
    Terminal window
    edit src/clj/io/github/amiorin/once/options.clj
    edit bb.edn
  • Create Everything:
    Terminal window
    bb once create
  • Delete Everything:
    Terminal window
    bb once delete
  • Run Tofu Directly:
    Terminal window
    bb tofu render tofu:init tofu:apply:-auto-approve
  • Run Ansible Directly:
    Terminal window
    bb ansible render -- ansible-playbook main.yml

You can also trigger workflows programmatically in a REPL:

(require '[io.github.amiorin.once.package :as once])
(require '[io.github.amiorin.once.options :as options])
(once/once* "create" options/oci)

The tool uses big-config for configuration. Default options for different hyperscalers are defined in io.github.amiorin.once.options.

{:hyperscaler "oci"
:package "once"
:config-file-profile "DEFAULT"
:subnet-id "..."
:compartment-id "..."
:availability-domain "..."
:display-name "my-instance"
:shape "VM.Standard.A1.Flex"
:ocpus 2
:memory-in-gbs 12
:boot-volume-size-in-gbs 100
:ssh-authorized-keys "~/.ssh/id_ed25519.pub"}
  • src/clj/io/github/amiorin/once/: Core logic and workflow definitions.
    • tools.clj: Wrappers for tofu and ansible.
    • package.clj: High-level create and delete workflows.
    • options.clj: Default configuration options.
  • src/resources/io/github/amiorin/once/tools/: Templates for Tofu and Ansible.
    • tofu/: OpenTofu configuration templates for hcloud and oci.
    • ansible/: Ansible playbooks and configurations.
    • ansible-local/: Local Ansible configurations.

Copyright © 2026 Alberto Miorin

Distributed under the MIT License.