Orchestration and configuration management in Python
Project description
Fuselage
fuselage is a simple and fast idempotent configuration bundle builder and runtime.
To use fuselage:
- Use your code to build a configuration bundle via our API. The output is an executable payload.
- Transfer that payload to your server.
- Run it.
Should you use fuselage? Probably not. But if you are wondering why:
- It's fast. Unlike some configuration management tools the entire process runs on the target. It doesn't rely on a round trip between every step.
- It's small. It's only dependency is a python3 interpreter on the target system plus some common posix binaries.
- It's secure. It doesn't bring it's own control plane that you need to understand in detail to properly secure.
- It's simple. It provides the absolute minimum, and tries to get out the way for the stuff where it doesn't need to have an opinion. Bring your own template engine, or don't use one at all. Bring your own control plane. Run it from a deamonset, run it via fabric or even just use scp and run it by hand.
Using with paramiko
import paramiko
from fuselage.bundle import ResourceBundle
from fuselage.resources import *
from fuselage.ssh import execute_via_ssh
bundle = ResourceBundle()
bundle.add(File(
name="/tmp/hello.txt",
contents="A test file!!",
))
transport = paramiko.Transport(("localhost", 22))
transport.connect(
username="john",
password="my super sekrit password",
)
# Compile the bundle, scp it to target server, execute it via sudo
execute_via_ssh(
transport,
bundle,
"root",
sudo_password="my super sekrit password"
)
Using with fabric
You will need to install fabric explicitly. Fuselage does not depend on fabric.
You can write simple deployment scripts with Fabric by adding this to your fabfile:
from fuselage.fabric import blueprint
from fuselage.resources import *
@blueprint
def minecraft(bundle):
yield Directory(
name='/var/local/minecraft',
)
yield Execute(
command='wget https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar',
cwd="/var/local/minecraft",
creates="/var/local/minecraft/minecraft_server.1.8.jar",
)
yield File(
name='/var/local/minecraft/server.properties',
contents=open('var_local_minecraft_server.properties').read(),
)
yield File(
name="/etc/systemd/system/minecraft.service",
contents=open("etc_systemd_system_minecraft.service"),
)
yield Execute(
command="systemctl daemon-reload",
watches=['/etc/systemd/system/minecraft.service'],
)
yield Execute(
command="systemctl restart minecraft.service",
watches=[
"/var/local/minecraft/server.properties",
"/etc/systemd/system/minecraft.service",
]
)
And then run it against multiple servers::
fab -H server1,server2,server3 minecraft
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fuselage-3.1.2.tar.gz
(44.7 kB
view details)
Built Distribution
fuselage-3.1.2-py3-none-any.whl
(81.7 kB
view details)
File details
Details for the file fuselage-3.1.2.tar.gz
.
File metadata
- Download URL: fuselage-3.1.2.tar.gz
- Upload date:
- Size: 44.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a96e45985fea3724e50e52315f1e64339032739be4a2ad238bafa3d2e018bf |
|
MD5 | b8ba83789d3ec716a39952e52e756abe |
|
BLAKE2b-256 | aaccac87223c544f9624f02af0884830f81a4a851245bd9dcc4e98fb502a465c |
Provenance
File details
Details for the file fuselage-3.1.2-py3-none-any.whl
.
File metadata
- Download URL: fuselage-3.1.2-py3-none-any.whl
- Upload date:
- Size: 81.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c55dfb894d89e70a24ba519a73f5aaa50e18f13341aff3dc3f5e75406a7ce34 |
|
MD5 | 0bd9c8723eeb389739286d8e86746fb8 |
|
BLAKE2b-256 | 217c50fb5d2b20ced52a09d2ddb162bb2fd969a2a281ec9951ee4c4c0b546cbb |