OpsWork Swiss Knife.
Project description
OpsWork
To use opswork, follow the following steps:
Create a python virtual environment or use system wide environment
$ python3 -m venv venv
$ source venv/bin/activate
Install opswork package with pip.
$ pip install opswork
Get opswork command line help
$ opswork --help
Init the config file and the sqlite database
$ opswork config init
To edit configs
$ opswork config init
Add a recipe
$ opswork recipe add <recipe_name> -p <recipe_relative_path>
# Some examples
$ opswork recipe add clivern/ping -p recipe/ping -f
$ opswork recipe add clivern/nginx -p recipe/nginx -f
$ opswork recipe add clivern/motd -p recipe/motd -f
$ opswork recipe add clivern/cmd -p recipe/cmd -f
# From remote git
$ opswork recipe add clivern/dotfiles/update -p git@github.com:clivern/dotfiles.git -s brew/update -t dotfiles -f
To list recipes
$ opswork recipe list
# Get recipes as a JSON
$ opswork recipe list -o json | jq .
To get a recipe
$ opswork recipe get <recipe_name>
To delete a recipe
$ opswork recipe delete <recipe_name>
Add a host
$ opswork host add <host_name> -i <host_ip> -p <ssh_port> -u <ssh_username> -s <ssh_key_path>
# Add a remote host
$ opswork host add example.com -i 127.0.0.1 -p 22 -u root -s /Users/root/.ssh/id_rsa.pem
# Add the localhost
$ opswork host add localhost -i localhost -c local
To list hosts
$ opswork host list
# Get hosts as a JSON
$ opswork host list -o json | jq .
To get a host
$ opswork host get <host_name>
To SSH into a host
$ opswork host ssh <host_name>
To delete a host
$ opswork host delete <host_name>
Run a recipe towards a host
$ opswork recipe run <recipe_name> -h <host_name> -v key=value
# Some examples
$ opswork recipe run clivern/nginx -h example.com
$ opswork recipe run clivern/ping -h localhost
To generate a random password
$ opswork random password 8
To add a secret
$ opswork secret add <secret/name> <secret_value> -t <tag>
$ opswork secret add clivern/cloud_provider/api_key xxxx-xxxx-xxxx-xxxx -t cloud_provider
To list secrets
$ opswork secret list -o json
To get a secret
$ opswork secret get <secret_name>
# For example
$ opswork secret get clivern/cloud_provider/api_key
To delete a secret
$ opswork secret delete <secret_name>
# For example
$ opswork secret delete clivern/cloud_provider/api_key
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
opswork-0.8.15.tar.gz
(22.0 kB
view details)
Built Distribution
opswork-0.8.15-py3-none-any.whl
(32.1 kB
view details)
File details
Details for the file opswork-0.8.15.tar.gz
.
File metadata
- Download URL: opswork-0.8.15.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d2ffd73324ac17e9c82b69fef634c80bb39767d0e76cc99d0dfa16766ad94ae |
|
MD5 | 3e5595199f191b34e3b0bb5d6d2ceaf6 |
|
BLAKE2b-256 | 2fd1866b32b9876c26cf407878a02738b3e8a199346af0468b826b65a6c5c986 |
File details
Details for the file opswork-0.8.15-py3-none-any.whl
.
File metadata
- Download URL: opswork-0.8.15-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed556d18eb3d25e7636eaca7d9c8c1a169e5bcc792327a309e30c5b5dab290e7 |
|
MD5 | 615fc1713b8fe8becdbae2e8873b5b99 |
|
BLAKE2b-256 | 793c85ed1c4b6a3a55b8798384494228b9e4bcd67c97f0d9d7d9ed84aff63d9c |