Skip to main content
PyPI-Server Build Status Downloads

OpsWork

To use opswork, follow the following steps:

  1. Create a python virtual environment or use system wide environment

$ python3 -m venv venv
$ source venv/bin/activate
  1. Install opswork package with pip.

$ pip install opswork
  1. Get opswork command line help

$ opswork --help
  1. Init the config file and the sqlite database

$ opswork config init
  1. To edit configs

$ opswork config init
  1. 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
  1. To list recipes

$ opswork recipe list

# Get recipes as a JSON
$ opswork recipe list -o json | jq .
  1. To get a recipe

$ opswork recipe get <recipe_name>
  1. To delete a recipe

$ opswork recipe delete <recipe_name>
  1. 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
  1. To list hosts

$ opswork host list

# Get hosts as a JSON
$ opswork host list -o json | jq .
  1. To get a host

$ opswork host get <host_name>
  1. To SSH into a host

$ opswork host ssh <host_name>
  1. To delete a host

$ opswork host delete <host_name>
  1. 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
  1. To generate a random password

$ opswork random password 8
  1. 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
  1. To list secrets

$ opswork secret list -o json
  1. To get a secret

$ opswork secret get <secret_name>

# For example
$ opswork secret get clivern/cloud_provider/api_key
  1. To delete a secret

$ opswork secret delete <secret_name>

# For example
$ opswork secret delete clivern/cloud_provider/api_key
  1. To run a recipe with secrets

# add recipe
$ opswork recipe add clivern/secrets -p recipe/secrets -f

# add secret
$ opswork secret add db_password s3cr3t --force

# run recipe
$ opswork recipe run clivern/secrets -h localhost
  1. To batch load recipes and run them

$ opswork batch load batch.yml --force

$ opswork batch run batch.yml --host localhost

Release files for opswork 0.10.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opswork 0.10.2
File Size Uploaded
opswork-0.10.2.tar.gz 23.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opswork 0.10.2
File Interpreter ABI Platform
opswork-0.10.2-py3-none-any.whl Python 3 none any Details

Total release size: 58.2 kB

Release files / opswork-0.10.2.tar.gz

Download URL opswork-0.10.2.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
10b335396e09100f8cfeff2675f6d500edae6a2bff5c757e4be677c533210f5f
BLAKE2b-256 checksum
How to use checksums
42f0b3c2186146be1e223afa52d63fdd4403b78cc58416b03df78711f28fcd16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / opswork-0.10.2-py3-none-any.whl

Download URL opswork-0.10.2-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
884485c7169a7d719bbbd374f6cf39def30ed9cc528a7ccf67732ddaf10f8b3f
BLAKE2b-256 checksum
How to use checksums
0f9606007e1de874bb4885642f74ede886b3efba6d14b133871a899f8dcb01a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page