Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to configure several ansible+mitogen envrionments on one linux ? #1076

Open
dcpc007 opened this issue May 15, 2024 · 0 comments
Open

how to configure several ansible+mitogen envrionments on one linux ? #1076

dcpc007 opened this issue May 15, 2024 · 0 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@dcpc007
Copy link

dcpc007 commented May 15, 2024

Hello,

We still have some old big projects in ansible2.6 + mitogen 0.2.10, and newer ones (or in migration) to ansible 6 + mitogen 0.3.

Then i need to switch ansible-playbook commands from one env to the other.

My current solution is not perfect :

  • i install the 2 mitogen binaries in 2 folders + a symlink to activate one version
  • i made 2 pipenv for each ansible
  • i have 2 bash script to activate one or other version :
#!/bin/zsh
sudo ln -sfn /usr/local/bin/mitogen-0.3.4 /usr/local/bin/mitogen
cdir=$(pwd) && export cdir && PIPENV_PIPFILE=/home/user/python/ansible6.7/Pipfile pipenv shell "cd ${cdir} && pip -V"

I would pipenv install mitogen=0.x.x in my pipenv, but it doesn't provide the binary that match ansible.cfg config :

strategy_plugins   = /usr/local/bin/mitogen/ansible_mitogen/plugins/strategy
strategy = mitogen_linear

Here is the Pipfile for 6.7 :

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
ansible = "==6.7.0"
kubernetes = "*"

[dev-packages]
ansible-lint = "*"

[requires]
python_version = "3.11"

and for 2.9 :

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
ansible = "==2.9.27"
jinja2 = "*"
(mitogen = "==0.2.10") --> it's a try but no binary installed with this it seems ?

[dev-packages]
ansible-lint = "==5.4.0"

[requires]
python_version = "3.11"

Note : i'm thinking on another solution too :
generate custom docker images including python + ansible + mitogen, and map volumes to known path corresponding to system binary + ansible.cfg configured paths...

thx for your feedbacks.

@dcpc007 dcpc007 added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

1 participant