[python] convert dictionary to yaml and vice versa

Nornir framework comes with the pyyaml module installed, hence I do not need to install pyyaml. Convert dictionary to yaml The purpose is to accept json data from the api gateway and convert this into yaml in the backend to be sent over to ansible through nornir. The below is a test on convert dictionary … Continue reading [python] convert dictionary to yaml and vice versa

[python]Show version with Ansible

Introduction These python scripts do the following: init_vault.py, initialized the vault and create an encryption key. The initialization creates 5 keys and 1 root token for unsealing and login the vault respectively. get_vault_resuly.py, this script gets the keys and token to unseal and login the vault. vault_mgmt.py, this script gets the key and value pair … Continue reading [python]Show version with Ansible

[python]Sample encrypting and decrypting the dictionary

I am preparing for a credential in dictionary data type to be used in later projects, the entire credential has to be encrypted including username. First I generate the key for the Fernet cipher, then I get the credential if the creds.enc file is not present. The obtained credential is updated in the credential dictionary. … Continue reading [python]Sample encrypting and decrypting the dictionary

[python]Listing items with iControl API without using F5 SDK

After I have discovered that F5 SDK could not do certain things, I have decided to learn how to call the REST APIs using request and parse the json response. The first step i am learning is to use GET after that I will use POST using the json.dumps method. This code is part of … Continue reading [python]Listing items with iControl API without using F5 SDK