::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.
Features
Section titled “Features”- Workflow Orchestration: Orchestrate complex multi-step processes like
tofu init/applyfollowed byansible-playbookexecutions. - Hyperscaler Support: Supports infrastructure provisioning on:
- Hetzner Cloud (
hcloud) - Oracle Cloud Infrastructure (
oci)
- Hetzner Cloud (
- 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.
Prerequisites
Section titled “Prerequisites”To use package once, you need the following tools installed:
- Clojure
- Babashka (optional, for CLI tasks)
- OpenTofu
- Ansible
- Cloud provider credentials (e.g.,
HCLOUD_TOKENor OCI configuration)
once can be used via Babashka tasks or as a Clojure library.
Using Babashka Tasks
Section titled “Using Babashka Tasks”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.cljedit 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
Using as a Clojure Library
Section titled “Using as a Clojure Library”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)Configuration
Section titled “Configuration”The tool uses big-config for configuration. Default options for different hyperscalers are defined in io.github.amiorin.once.options.
OCI Configuration Example
Section titled “OCI Configuration Example”{: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"}Project Structure
Section titled “Project Structure”src/clj/io/github/amiorin/once/: Core logic and workflow definitions.tools.clj: Wrappers fortofuandansible.package.clj: High-levelcreateanddeleteworkflows.options.clj: Default configuration options.
src/resources/io/github/amiorin/once/tools/: Templates for Tofu and Ansible.tofu/: OpenTofu configuration templates forhcloudandoci.ansible/: Ansible playbooks and configurations.ansible-local/: Local Ansible configurations.
License
Section titled “License”Copyright © 2026 Alberto Miorin
Distributed under the MIT License.