![]() Kubernetes: list all pods in deployment.GKE: Determine Anthos on-prem GKE master node and IP address.Terraform: migrate state from local to remote Google Cloud Storage bucket and back.Python: fixing ‘CryptographyDeprecationWarning: Blowfish has been deprecated’.GKE: upgrade Anthos Config Management for GKE cluster.GKE: show pod distribution across nodes and zones.Ansible: adding custom apt repository with ‘signed-by’ gpg key.GCP: Cloud Run/Function to handle requests to GKE cluster during maintenance.Kubernetes: using a delete patch with kustomize.GCP: deploying a Python WSGI Gunicorn app on Cloud Run.GCP: Cloud Run with build trigger coming from remote GitHub repository.GKE: terraform lifecycle ‘ignore_changes’ to manage external changes to GKE cluster.GCP: determining whether GKE cluster mode is Standard or Autopilot.Bash: testing if a file exists, has content, and is recently modified.GCP: determining whether ASM is installed via asmcli or gcloud fleet.Ansible: find module to create glob of remote files.Ansible: Ubuntu alternatives using the community.general collection. ![]() Ansible: deleting a file path, but only if a symbolic link.Ansible: generating templates with deep directory structure using with_filetree.Ansible: pulling values from nested dictionaries when path might not exist.Here is the ouput that ‘my_json_structure’ emulates - stat: Middlewareinventory, json_query combine and with_items technique name: install community.general collection from ansible galaxyĬmd: ansible-galaxy collection install community.general name: ensure jmespath is installed to support json_query filter # required pip moduleĪnsible-galaxy collection install community.general The use of json_query requires the ‘jmespath’ python module and ‘community.general’ Ansible Galaxy module. The full playbook can be found on my github, datastructure-to-dict.yml Use ‘map’ to extract just the paths as an array. What is returned is an array of deeply nested values that simplified can be represented like below: vars: If you have a complex JSON data structure or perhaps an array of rich data structures as the result of module output, you may want to extract this into a workable list or dictionary you can take action on.įor this article, I will emulate the resulting output from the ‘ stat‘ module when it checks for file existence using ‘with_fileglob’. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |