Read-only mirror of https://github.com/StadtLuzernIO/ansible-budibase-collection — Stadt Luzern. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-05-24 13:45:01 +02:00
docs modified: docs/execute_a_query.rst 2023-05-22 13:50:59 +02:00
meta add version 1.0.3 2023-05-15 17:37:05 +02:00
plugins add version 1.0.3 2023-05-15 17:37:05 +02:00
.gitignore add version 1.0.3 2023-05-15 17:37:05 +02:00
galaxy.yml modified: galaxy.yml 2023-05-16 08:08:07 +02:00
LICENSE Initial commit 2023-05-11 14:06:49 +02:00
README.md modified: README.md 2023-05-24 13:45:01 +02:00

Ansible Collection: StadtLuzernIO.Budibase

Overview

This repository contains Budibase Ansible Modules, which one can use with Ansible to work with the Budibase.

For general information about Ansible, visit the GitHub project page.

What is Budibase

Budibase

Budibase is an all-in-one open-source low-code platform for building, designing, and automating business apps, such as; admin panels, forms, internal tools, client portals, and more. Before Budibase, it could take developers weeks to build simple CRUD apps; with Budibase, building CRUD apps takes minutes.

Get started with Budibase

When getting started with Budibase, you have two options:

  1. Use Budibase Cloud - Budibase host your apps. This is the easier, faster option. No docs are required to get started.
  2. Self-host Budibase - you host your apps. You can find further instructions below.

Cloud

The onboarding process is simple, minimal, and takes seconds. No docs are required.

Self-Hosting

Deploy Budibase self-hosted in your existing infrastructure, using Docker, Kubernetes, and Digital Ocean.

Prerequisites

The below prerequisites are needed on the local Ansible controller node that executes this ansible collection.

Installation and Usage

Installing the Collection from Ansible Galaxy

Before using the StadtLuzernIO budibase collection, you need to install the collection with the ansible-galaxy cli:

ansible-galaxy collection install stadtluzernio.budibase

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml using the format:

# requirements.yml
collections:
  - name: stadtluzernio.budibase

Use this Collection in a AWX Project

Project Folder

.
└── project_name
    ├── collections
    │   └──  requirements.yml
    ├── PLAYBOOK_NAME_01.yml
    ├── PLAYBOOK_NAME_02.yml
    └── PLAYBOOK_NAME_...yml

Credential Type

Credential type to add the Budibase authentication information as AWX credential.

awx_credential_type_settings:
  - name: Budibase API
    description: Credential Type for Budibase API
    state: present
    kind: cloud
    inputs:
      fields:
        - id: budibase_host
          type: string
          label: Host
          help_text: Budibase FQDN
        - id: budibase_token
          type: string
          label: API Token
          secret: true
          help_text: budibase token to use
      required:
        - budibase_host
        - budibase_token
    injectors:   
      env:
        BUDIBASE_HOST: '{{ budibase_host }}'
        BUDIBASE_TOKEN: '{{ budibase_token }}'

awx_credential_type_settings

Credential

awx_credentials_settings:
  - name: Budibase Credential
    credential_type: Budibase API
    organization: My Organisation
    inputs:
      budibase_host: my-budibase-host.my-domain.ch
      budibase_token: afjajsfjsacvksd89rjdd32d02dk20dk2d

awx_credentials_settings

Job Template

Add the credentials to the jop template, in which you use this collection.

awx_job_template_settings

Module Variables

All modules support the following variable definitions. You may either explicitly define the value on the task or let Ansible fallback to an environment variable to use the same value across all tasks.

Environment variables are ignored if the module variable is defined for a task.

Module Variable Environment Variable Description
hostname BUDIBASE_HOST FQDN of a Budibase host.
token BUDIBASE_TOKEN Your individual API key, this will provide access based on the configured RBAC settings of your user.

Included content

Modules

Name Description
stadtluzernio.budibase.execute_a_query Can executed queries which have been created in a Budibase app
stadtluzernio.budibase.search_for_rows Get rows from a table in a Budibase app

Demo Example

https://fibac.budibase.app/app/stadtluzernio#/INVENTORY

budibase_demo_inventory

  - name: "SELECT * FROM inventory WHERE os_family_name == window"
    stadtluzernio.budibase.search_for_rows:
      hostname: fibac.budibase.app
      token: 93213c631817d5127b943417b8b6fe65-3906db218002c32a5712fab9327db0e9355626875be3d907e607b95c3e1a4b814f5d67c0a422
      app: stadtluzernio
      table: inventory
      status: published
      validate_certs: false
      conditions:
        query:
          equal:
            os_family_name: windows

About stadtluzern.io

stadtluzern.io is our public domain as dev's at the city government of luzern. Please refer to our official website for any other inquiries.

License

The Unlicense, see LICENSE file.