Skip to main content

A desired state system for ansible

Project description

# Desired State Configuration

Desired state configuration allows users to focus on what they want instead of how to make it so. This simplifies automation for domain experts and allows automation experts to make generic operations that will work for many configurations.

# Getting Started

This repository uses [pipenv](https://pypi-hypernode.com/project/pipenv/) to manage the dependencies. To install the dependencies for a development environment run the following commands:

pipenv install –dev

To load the shell for this environment run these commands:

pipenv shell

To install an example collection use this command:

ansible-galaxy collection install benthomasson.expect

To run the tests use this command after opening the shell:

pytest -v

# Code Organization

This project uses event driven programming using finite state machines to provide deterministic and correct behavior. This allows the project to react to external events easily.

The entry point for the CLI commands is located the [cli.py](desired_state/cli.py) file.

Message types between finite state machines are defined in [messages.py](desired_state/messages.py).

The reconciliation loop is defined as a finite state machine in [reconciliation_fsm.py](desired_state/reconciliation_fsm.py)

The main monitor process which contains the reconciliation loop is defined in [monitor.py](desired_state/monitor.py)

The generation of playbooks based on the differences between states is defined in [diff.py](desired_state/diff.py).

Selection of appropriate change rules based on state diff is defined in [rule.py](desired_state/rule.py)

A client/server implementation for injecting desired state into the monitor process is defined in the [client.py](desired_state/client.py) and [server.py](desired_state/server.py) files.

Collection support is defined in [collection.py](desired_state/collection.py).

Streaming telemetry is defined in [stream.py](desired_state/stream.py).

State schema validation is provided in [validate.py](desired_state/validate.py).

History

0.1.0 (2020-09-02)

  • First release on PyPI.

Project details


Download files

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

Source Distribution

desired_state-0.1.0.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

desired_state-0.1.0-py2.py3-none-any.whl (21.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file desired_state-0.1.0.tar.gz.

File metadata

  • Download URL: desired_state-0.1.0.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for desired_state-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6d7075f9df6f29a89036ee1bfda0cde780ca1fa7865fb1db4da27bbfed3a4b8
MD5 c2201ee69aa77e81a7e07c0efaff08ce
BLAKE2b-256 db7da308c2f6837c08972db53522b7dbfd4cb78c75326441b24dbaf78ee6ef83

See more details on using hashes here.

File details

Details for the file desired_state-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: desired_state-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for desired_state-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e08a548281abf8f4a750c32f6142f017e43198f55d0cb0a54c1d9f25d8c08ee
MD5 8d9147897993d36b878bd58ac55d3c31
BLAKE2b-256 6ea13fde9bca694cdcd3c37184718fa0265aa9d5f1e4a100f842a86bf438226e

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