简体   繁体   English

如何配置AWX以使用未发行的Ansible版本

[英]How to configure AWX for using an unreleased version of Ansible

I have installed AWX using the galaxy role obtained with ansible-galaxy install geerlingguy.awx . 我已经使用ansible-galaxy install geerlingguy.awx获得的星系角色安装了AWX。

It installs the devel branch of awx, however jobs still use the stable version of ansible. 它安装了awx的devel分支,但是作业仍使用ansible的稳定版本。

Is there a way to control the version of ansible used by jobs when running playbooks from AWX? 从AWX运行剧本时,是否可以控制作业使用的ansible版本?

I solved the issue leveraging virtualenvs as per an hint from https://groups.google.com/forum/#!topic/awx-project/AlWbCrlpIC0 我根据https://groups.google.com/forum/#!topic/awx-project/AlWbCrlpIC0的提示利用virtualenvs解决了该问题

So it was a matter of creating a virtualenv on docker containers and enabling it for the organization: 因此,这是在docker容器上创建virtualenv并为组织启用它的问题:

docker exec -it awx_web bash

virtualenv /var/lib/awx/venv/ansible27
yum install -y gcc
yum install -y python-devel
/var/lib/awx/venv/ansible27/bin/pip install python-memcached psutil
/var/lib/awx/venv/ansible27/bin/pip install -U "ansible == 2.7.0"

exit

docker exec -it awx_task bash

virtualenv /var/lib/awx/venv/ansible27
yum install -y gcc
yum install -y python-devel
/var/lib/awx/venv/ansible27/bin/pip install python-memcached psutil
/var/lib/awx/venv/ansible27/bin/pip install -U "ansible == 2.7.0"

exit

curl  -u 'admin:password' -X PATCH -H 'Content-Type: application/json' http://127.0.0.1/api/v2/organizations/MYORG/ -d '
{
    "custom_virtualenv": "/var/lib/awx/venv/ansible27"
}
'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM