Skip to main content

LSO, an API for remotely running Ansible playbooks.

Project description

Lightweight Service Orchestrator Supported python versions Downloads codecov

LSO: an API that allows for remotely executing Ansible playbooks.

Code documentation

Code documentation can be found at https://workfloworchestrator.org/lso

Quick start

This is a quick setup guide for running on your local machine.

As a Docker container

To run LSO as a Docker container, build an image using the Dockerfile.example as an example. Be sure to update requirements.txt and ansible-galaxy-requirements.yaml accordingly, depending on your specific Ansible collection and -role needs.

Use the Docker image to then spin up an environment. An example Docker compose file is presented below:

services:
  lso:
    image: my-lso:latest
    environment:
      SETTINGS_FILENAME: /app/config.json
      ANSIBLE_ROLES_PATH: /app/lso/ansible_roles
    volumes:
      - "/home/user/config.json:/app/config.json:ro"
      - "/home/user/ansible_inventory:/opt/ansible_inventory:ro"
      - "~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro"
      - "~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro"

This will expose the API on port 8000. The container requires some more files to be mounted:

  • A config.json that references to the location where the Ansible playbooks are stored inside the container.
  • An Ansible inventory for all host and group variables that are used in the playbooks
  • A public/private key pair for SSH authentication on external machines that are targeted by Ansible playbooks.
  • Any Ansible-specific configuration (such as collections_path, roles_path, etc.) should be set using environment variables. ANSIBLE_ROLES_PATH is given as an example in the Docker compose snippet above.

Install the module

As an alternative, below are a set of instructions for installing and running LSO directly on a machine.

One of these should be what you're looking for:

  • Install the latest release
  python3 -m venv my-venv-directory
  . my-venv-directory/bin/activate

  pip install orchestrator-lso
  • Install the source code
  git clone https://github.com/workfloworchestrator/lso.git && cd lso
  python3 -m venv my-venv-directory
  . my-venv-directory/bin/activate
  
  pip install flit
  flit install --deps production
  
  # Or, for the full development environment
  flit install --deps develop

Running the app

  • Create a settings file, see config.json.example for an example.
  • If necessary, set the environment variable ANSIBLE_HOME to a custom path.
  • Run the app like this (app.py starts the server on port 44444):
  SETTINGS_FILENAME=/absolute/path/to/config.json python -m lso.app

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orchestrator_lso-1.0.3.tar.gz (296.3 kB view details)

Uploaded Source

Built Distribution

orchestrator_lso-1.0.3-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file orchestrator_lso-1.0.3.tar.gz.

File metadata

  • Download URL: orchestrator_lso-1.0.3.tar.gz
  • Upload date:
  • Size: 296.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for orchestrator_lso-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3cbab4b41d3fcce7fd01613ddbcd1dd3b6bc2ce816d75179dd88f6aebc1d83ba
MD5 a3509c69321779efad3ab0ffca8864e9
BLAKE2b-256 099d8a1f4d8bf0944b08534467b479e0e7ad16767ef8049ab7e7cb7669940b94

See more details on using hashes here.

File details

Details for the file orchestrator_lso-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for orchestrator_lso-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bbaa235c1710651d33c14d9ec6d20a2733cb3d302edd8f57acab07108cdca30b
MD5 80e762a59fda6f670943da60f30f3391
BLAKE2b-256 533f3c7b05c9254dc2cdb8334f8517f63e62b22948b91d7633a650a5309eec23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page