Last active
February 19, 2023 17:12
-
-
Save AnatomicJC/d618d1938279f56b0bc3b5276fb0d167 to your computer and use it in GitHub Desktop.
Revisions
-
AnatomicJC renamed this gist
Feb 19, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
AnatomicJC created this gist
Feb 19, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ Create `requirements.txt` file: ``` ansible==7.2.0 ansible-lint==6.10.0 jmespath dnspython git+https://github.com/mitogen-hq/mitogen.git@a47b9f3631ba3c37bf0410c6a4960c3eec152454 ``` Create ansible-setup.bash: ``` #!/usr/bin/env bash set -euo pipefail SCRIPT_DIR=$(cd -- "$(dirname -- "$0")" && pwd -P) cd "${SCRIPT_DIR}" # ansible 7.2.0 is ansible-core 2.14.2 ANSIBLE_VERSION=7.2.0 sudo apt update sudo apt install -y python3-venv mkdir -p "${HOME}"/.ansible_venv python3 -m venv "${HOME}"/.ansible_venv/ansible-"${ANSIBLE_VERSION}" # shellcheck source=/dev/null source "${HOME}"/.ansible_venv/ansible-"${ANSIBLE_VERSION}"/bin/activate python3 -m pip install --use-pep517 --upgrade pip setuptools python3 -m pip install --use-pep517 -r requirements.txt # Mitogen sed -i "s/^ANSIBLE_VERSION_MAX = (2, 13)/ANSIBLE_VERSION_MAX = (2, 14)/" $(python3 -c "import sys; print(sys.path.pop())")/ansible_mitogen/loaders.py ``` Install ansible: ``` bash ansible-setup.bash ``` Load ansible python virtualenv and enable mitogen: ``` . ~/ansible_venv/ansible-7.2.0/bin/activate export ANSIBLE_STRATEGY_PLUGINS=$(python3 -c "import sys; print(sys.path.pop())")/ansible_mitogen/plugins/strategy export ANSIBLE_STRATEGY=mitogen_linear ```