Ansible 2.4: Properly load the configuration file parser

Due to a misunderstanding of how configuration loading occured in
Ansible 2.4, we did not load the configuration file. It turns out
we have to do it ourselves now so let's do that.

This also requires a fix in the Ansible get_config method which
was merged [1] and backported for 2.4.1.0.
We're not going to work around the bug in Ansible 2.4.0.0 and as such,
blacklist that version and coordinate a new ARA release with Ansible
2.4.1.0.

[1]: https://github.com/ansible/ansible/pull/31200

Change-Id: I691ef992c9c6b698f03927e2b69de26f0c1d57d1
This commit is contained in:
David Moreau-Simard 2017-10-04 13:45:51 -04:00
parent 5a19c42ed4
commit 8747ff4500
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
3 changed files with 5 additions and 2 deletions

View File

@ -30,10 +30,10 @@ try:
except ImportError:
# Ansible 2.4 no longer provides load_config_file, this is handled further
# down
from ansible.config.manager import find_ini_config_file
# Also, don't scream deprecated things at us
import ansible.constants
ansible.constants._deprecated = lambda *args: None
pass
from distutils.version import LooseVersion
from six.moves import configparser
@ -95,7 +95,9 @@ DEFAULTS = {
if LooseVersion(ansible_version) < LooseVersion('2.4.0'):
config, path = load_config_file()
else:
path = find_ini_config_file()
config = configparser.ConfigParser()
config.read(path)
# Some defaults need to be based on top of a "processed" ARA_DIR
ARA_DIR = _ara_config(config, 'dir', 'ARA_DIR')

View File

@ -1,7 +1,7 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
jinja2>=2.9
ansible>=2.2.0.0
ansible>=2.2.0.0,!=2.4.0.0
Flask>=0.11,<0.13
Flask-SQLAlchemy
Flask-Migrate

View File

@ -108,6 +108,7 @@ fi
# Install ARA so it can be used from a virtual environment
tox -e ${python_version} --notest
source .tox/${python_version}/bin/activate
ansible_version=$(pip freeze |awk -F== '/ansible==/ {print $2}')
ansible --version
python --version