From aaf021ed81b60fe55aeafabd32d1b1a1907724eb Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 22 Jan 2024 10:33:33 -0600 Subject: [PATCH 1/3] gitignore another common python venv name .venv is another commonly used Python virtualenv name that folks use so add it to the ignore list. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 07aa5c34..47e4ec23 100644 --- a/.gitignore +++ b/.gitignore @@ -104,6 +104,7 @@ target/ # virtualenv venv/ +.venv/ ENV/ # molecule From d639bd283e34f2e886614ac168ed7bebcedf49aa Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 22 Jan 2024 10:35:52 -0600 Subject: [PATCH 2/3] don't use the global collections by default Since this installs its own collections, let's avoid stomping on things with other work the user might have going on. --- .gitignore | 1 + ansible/playbooks/ansible.cfg | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 47e4ec23..f292df97 100644 --- a/.gitignore +++ b/.gitignore @@ -120,5 +120,6 @@ tmp.md # Ansible collection files kubernetes_sigs-kubespray*tar.gz ansible_collections +ansible/playbooks/collections kustomize/**/all.yaml diff --git a/ansible/playbooks/ansible.cfg b/ansible/playbooks/ansible.cfg index 8f63e44c..a113a780 100644 --- a/ansible/playbooks/ansible.cfg +++ b/ansible/playbooks/ansible.cfg @@ -15,6 +15,8 @@ callbacks_enabled = profile_tasks deprecation_warnings = False inventory_ignore_extensions = ~, .orig, .bak, .ini, .cfg, .retry, .pyc, .pyo, .creds, .gpg, .example enable_plugins = host_list, script, auto, yaml, ini, toml +# install and use local collections instead of global +collections_paths = ./collections/ansible_collections [inventory] ignore_patterns = artifacts, credentials From 93ffa8b8698bbdcf6d04f767dcc711ba37b83000 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Tue, 30 Jan 2024 08:08:51 -0600 Subject: [PATCH 3/3] use YAML output from ansible as it makes reading errors easier Opinionated commit here that it's easier to read the YAML output on failure then it is to read the giant single line JSON blob when a failure happens. --- ansible/playbooks/ansible.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/ansible.cfg b/ansible/playbooks/ansible.cfg index a113a780..b0fb054e 100644 --- a/ansible/playbooks/ansible.cfg +++ b/ansible/playbooks/ansible.cfg @@ -9,7 +9,10 @@ gathering = smart fact_caching = jsonfile fact_caching_connection = /tmp fact_caching_timeout = 86400 -stdout_callback = default +# Use the YAML callback plugin because it's easier to read the errors +stdout_callback = YAML +# Use the stdout_callback when running ad-hoc commands. +bin_ansible_callbacks = True display_skipped_hosts = no callbacks_enabled = profile_tasks deprecation_warnings = False