No project description provided
Project description
CSP Cloud Provider for Idem
DEVELOPMENT
Clone the idem-csp repository and install with pip.
git clone git@gitlab.com:saltstack/pop/idem-csp.git
pip install -e idem_csp
ACCT
After installation the CSP Idem Provider execution and state modules will be accessible to the pop hub. In order to use them we need to set up our credentials. Follow the instructions to generate an api token.
Create a new file called credentials.yaml and populate it with credentials. The default profile will be used automatically by idem unless you specify one with –acct-profile=profile_name on the cli.
There are many ways aws providers/profiles can be stored. See acct backends for more information.
A profile needs to specify the api key it uses and can optionally specify the api url.
credentials.yaml
csp.token:
default:
refresh_token: dmd23q3au8ljyajcvhz207of4ivsn9vjiaxzez223qeagdpe0voqiasknykv58jt
default_org_id: my_org
# Optional configuration, defaults will be used for these values if not supplied
csp_url: https://console.cloud.vmware.com
default_org_id: defaults_to_the_logged_in_user_org_id
A profile can also be created that uses an access_token directly. However, a csp_url and default_org_id must be explicitly defined.
credentials.yaml
csp:
my_profile:
csp_url: https://console.cloud.vmware.com
access_token: kl2k3jjoij0un093wjn092w34jta0-3
default_org_id: my_org_id
Now encrypt the credentials file and add the encryption key and encrypted file path to the ENVIRONMENT.
The acct command should be available as it is a requisite of idem and idem-csp. Encrypt the the credential file.
acct encrypt credentials.yaml
output:
-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI=
Add these to your environment:
export ACCT_KEY="-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI="
export ACCT_FILE=$PWD/credentials.yaml.fernet
USAGE
A profile can be specified for use with a specific state. If no profile is specified, the profile called “default”, if one exists, will be used:
ensure_user_exists:
csp.org.user.present:
- acct_profile: my-staging-env
- name: a_user_name
- kwarg1: val1
It can also be specified from the command line when executing states.
idem state --acct-profile my-staging-env my_state.sls
It can also be specified from the command line when calling an exec module directly.
idem exec --acct-profile my-staging-env csp.org.user.list
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
Built Distribution
File details
Details for the file idem-csp-1.0.1.tar.gz
.
File metadata
- Download URL: idem-csp-1.0.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ccd7c87edbf189b82b5b97468f038a7ae51f92a74b21d999c7c6ad59f05272d |
|
MD5 | 55f4db8da4e61ae0ad20d7ced2657bff |
|
BLAKE2b-256 | 2521ac362a1faa5686c1de81a66074d6e2187a7f05e2efdabdec31bd1dc7f8a6 |
File details
Details for the file idem_csp-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: idem_csp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23d1c39f7a3e65c8a1cfdcaf8914390129f00ab555c6803c307d46482cef55a7 |
|
MD5 | 2871acbdf09e25e5b6ebed0ac82e748d |
|
BLAKE2b-256 | 88133b3d9e897d9e2c8ab236200a0de7dcd271e9082bc2d258dce3f2c507ca86 |