From 073c69a1a63cfbad45b6d2d5227b563434ba1695 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Thu, 31 Oct 2019 13:26:12 +0200
Subject: [PATCH] Ansible config changes.

Per
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#the-configuration-file
the ~/.ansible.cfg file is ignored if another is found first. So use
environment variables instead so they work with all of my setups (the
internded purpose). Also, for the ansible-local and
ansible-local-playbook aliases, use the Python3 interpreter that was
used to run Ansible in the first so that modules (like postgresql_privs)
that require Python module have access to them.
---
 .ansible.cfg | 23 -----------------------
 .bashrc      |  5 +++--
 2 files changed, 3 insertions(+), 25 deletions(-)
 delete mode 100644 .ansible.cfg

diff --git a/.ansible.cfg b/.ansible.cfg
deleted file mode 100644
index 8c7fd34..0000000
--- a/.ansible.cfg
+++ /dev/null
@@ -1,23 +0,0 @@
-[defaults]
-command_warnings = True
-deprecation_warnings = True
-gathering = smart
-fact_caching = jsonfile
-fact_caching_connection = /tmp/ansible_fact_cache/
-fact_caching_timeout = 86400
-#vault_password_file = ~/.ansible-vault
-#host_key_checking = False
-forks = 5
-inventory = inventory
-#sudo_exe = sudo # OpenBSD uses doas from 5.8.
-retry_files_save_path = /tmp/
-callback_whitelist = profile_tasks
-
-[ssh_connection]
-pipelining = True
-
-[privilege_escalation]
-#become = True
-#become_method = sudo
-#become_user = root
-#become_ask_pass = False
diff --git a/.bashrc b/.bashrc
index c8088ae..6a82356 100644
--- a/.bashrc
+++ b/.bashrc
@@ -34,6 +34,7 @@ export ANSIBLE_CALLBACK_WHITELIST="profile_tasks, timer"
 export ANSIBLE_SSH_CONTROL_PATH="/tmp/ssh-%%h"
 export ANSIBLE_INVENTORY_ANY_UNPARSED_IS_FAILED=True
 export ANSIBLE_PYTHON_INTERPRETER=auto
+export ANSIBLE_FORKS=5
 export LYNX_SAVE_SPACE="$HOME/Downloads"
 export LYNX_TEMP_SPACE="$HOME/.cache/lynx"
 export VAGRANT_DEFAULT_PROVIDER="virtualbox"
@@ -64,8 +65,8 @@ alias missing-recommends="aptitude search '~RBrecommends:~i'"
 alias missing-suggests="aptitude search '~RBsuggests:~i'"
 # shellcheck disable=SC2142
 alias deinstalled="dpkg --get-selections | awk 'BEGIN {exitcode=1}; \$2==\"deinstall\" {print \$1; exitcode=0}; END {exit exitcode}'"
-alias ansible-local='ansible localhost -c local -i localhost,'
-alias ansible-local-playbook='ansible-playbook -i localhost, -c local'
+alias ansible-local='ansible localhost -c local -i localhost, -e "ansible_python_interpreter=$(which python3)"'
+alias ansible-local-playbook='ansible-playbook -i localhost, -c local -e "ansible_python_interpreter=$(which python3)"'
 alias concat="perl -pe 's/\\n/\\\\n/g'"
 alias deconcat="perl -pe 's/\\\\n/\\n/g'"
 alias hostlocal='docker run --rm --privileged --net=host gliderlabs/hostlocal'
-- 
GitLab