mracek

command module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 1 Imported by: 0

README

mracek

Release codecov Software License Build status

mracek (Czech word meaning "little cloud") is a small command line tool to manage your OpenStack configuration files.

mracek is inspired by the awesome kubectx/kubens.

Features

  • mracek supports auto-completion under bash, fish and zsh shells.
  • mracek is opinionated about where it puts secrets (passwords, application credential secrets) and always puts them in secrets.yaml
  • the directory where the openstack config files are stored is configurable (defaults to $HOME/.config/openstack/). See configuration section below.

Examples

# Create a cloud
$ mracek create-cloud --username user1 --password very_secure --verify --auth-url https://cloud1.example.com:5000/v3 --project-name project1 --domain-name domain1 --region-name region1 cloud1

# Show cloud details
$ mracek show-cloud cloud1
---
auth:
    auth_url: https://cloud1.example.com:5000/v3
    username: user1
    password: <masked>
    project_name: project1
    domain_name: domain1
region_name: region1
verify: true

# Create a profile (a profile is a cloud stored in clouds-public.yaml)
$ mracek create-profile --username user1 --password very_secure --verify --auth-url https://cloud1.example.com:5000/v3 --project-name project1 --domain-name domain1 --region-name region1 profile1

# Show profile details
$ mracek show-profile profile1
---
auth:
    auth_url: https://cloud1.example.com:5000/v3
    username: user1
    password: <masked>
    project_name: project1
    domain_name: domain1
region_name: region1
verify: true

# List profiles
$ mracek list-profiles
profile1

# Use a cloud (exports the OS_CLOUD environment variable and launches a sub-shell)
$ mracek cloud1
Switching to cloud cloud1
$ env|grep ^OS_
OS_CLOUD=cloud1

# Delete a cloud
$ mracek delete-cloud cloud1

# Delete a profile
$ mracek delete-profile profile1

# Set cloud details
$ mracek set-cloud  --project-name project1 cloud1

# Set profile details
$ mracek set-profile  --project-name project1 profile1

# Copy cloud while changing the project name
$ mracek copy-cloud --project-name new-project source-cloud destination-cloud

# Smoke tests are basic tests, basically mracek just lists resources from several services (servers for nova, networks for neutron, etc...)
# Run smoke tests against a specific cloud
$ mracek smoke-tests some-cloud

# Run smoke tests against all regions in parallel
$ mracek smoke-tests

Installation

go install github.com/mchlumsky/mracek@latest

Configuration

mracek supports configuration through the configuration file $HOME/.mracek.yaml by default and can be changed with the --config command line flag.

Example:

---
# Can be overridden by environment variable MRACEK_OS_CONFIG_DIR
os-config-dir: /path/to/openstack/config

# Can be overridden by environment variable MRACEK_SHELL
shell: /usr/bin/zsh

# Only export the OS_CLOUD variable when calling `mracek <cloud-name>`
os-cloud-only: true

Acknowledgements

Special thanks to JetBrains for the Open Source development license. GoLand rules!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL