Skip to main content

OpsWork Swiss Knife.

Project description

PyPI-Server Build Status

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

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

opswork-0.8.18.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

opswork-0.8.18-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file opswork-0.8.18.tar.gz.

File metadata

  • Download URL: opswork-0.8.18.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

Hashes for opswork-0.8.18.tar.gz
Algorithm Hash digest
SHA256 26341d205c59a23523313c870c907fdb4ab4ba4e69f1c0a37a76ce600a49a9fa
MD5 24f5055640612a1fa73431d5c7c840f0
BLAKE2b-256 72d1b0fdd07359c9acbb3213113b2ba95dce826017150ebebb5a91d35aae0f71

See more details on using hashes here.

File details

Details for the file opswork-0.8.18-py3-none-any.whl.

File metadata

  • Download URL: opswork-0.8.18-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

Hashes for opswork-0.8.18-py3-none-any.whl
Algorithm Hash digest
SHA256 c96258c1ccec42e43ff2adc56fb2a194ada3cb141c93769b804a9b5349625659
MD5 d25ca7d9778c0a44096cf8c76060bf28
BLAKE2b-256 46dab8615a7f2e58615e6c52007cc2bd766926d98b2d9dbdc2684f7a8396b891

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