Add galaxy role path which will be ignored by git

This change will ensure that local testing, with online roles installed
via galaxy, are not creating a dirty git tree. To build the separation
an empty directory "roles.galaxy" has been added which the galaxy command
will use to install external roles. All of the role path settings have
been updated to accomodate this new directory.

Change-Id: If68fa43231b2efbcdc046070a098bd49f47cfdb2
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2019-07-18 13:30:34 -05:00
parent 81427894df
commit a94f91f4aa
No known key found for this signature in database
GPG Key ID: CE94BD890A47B20A
5 changed files with 10 additions and 7 deletions

3
.gitignore vendored
View File

@ -19,3 +19,6 @@ nosetests.xml
# Playbook retry files # Playbook retry files
*.retry *.retry
# roles
tripleo_ansible/roles.galaxy/*

View File

@ -31,11 +31,10 @@ repos:
files: \.(yaml|yml)$ files: \.(yaml|yml)$
entry: >- entry: >-
ansible-lint --force-color -v -x "ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0012,ANSIBLE0013,ANSIBLE0016" ansible-lint --force-color -v -x "ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0012,ANSIBLE0013,ANSIBLE0016"
--exclude=tripleo_ansible/roles/openstack-operations/tasks/restore_galera.yml --exclude=tripleo_ansible/roles.galaxy
--exclude=tripleo_ansible/roles/openstack-operations/tasks/restore_redis.yml
# TODO(cloudnull): These codes were added to pass the lint check. # TODO(cloudnull): These codes were added to pass the lint check.
# All of these ignore codes should be resolved in # Things found within roles.galaxy are external
# future PRs. # and not something maintained here.
- repo: https://github.com/openstack-dev/bashate.git - repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0 rev: 0.6.0
hooks: hooks:

View File

@ -5,7 +5,7 @@ export ANSIBLE_CALLBACK_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ans
export ANSIBLE_FILTER_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/filter" export ANSIBLE_FILTER_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/filter"
export ANSIBLE_LIBRARY="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/modules" export ANSIBLE_LIBRARY="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/modules"
export ANSIBLE_MODULE_UTILS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/module_utils" export ANSIBLE_MODULE_UTILS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/module_utils"
export ANSIBLE_ROLES_PATH="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/roles" export ANSIBLE_ROLES_PATH="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/roles.galaxy:${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/roles"
export ANSIBLE_INVENTORY="${TRIPLEO_ANSIBLE_WORKPATH}/tests/hosts.ini" export ANSIBLE_INVENTORY="${TRIPLEO_ANSIBLE_WORKPATH}/tests/hosts.ini"
export ANSIBLE_RETRY_FILES_ENABLED="0" export ANSIBLE_RETRY_FILES_ENABLED="0"
export ANSIBLE_LOAD_CALLBACK_PLUGINS="1" export ANSIBLE_LOAD_CALLBACK_PLUGINS="1"

View File

@ -14,7 +14,7 @@ setenv =
ANSIBLE_FILTER_PLUGINS={toxinidir}/tripleo_ansible/ansible_plugins/filter ANSIBLE_FILTER_PLUGINS={toxinidir}/tripleo_ansible/ansible_plugins/filter
ANSIBLE_LIBRARY={toxinidir}/tripleo_ansible/ansible_plugins/modules ANSIBLE_LIBRARY={toxinidir}/tripleo_ansible/ansible_plugins/modules
ANSIBLE_MODULE_UTILS={toxinidir}/tripleo_ansible/ansible_plugins/module_utils ANSIBLE_MODULE_UTILS={toxinidir}/tripleo_ansible/ansible_plugins/module_utils
ANSIBLE_ROLES_PATH={toxinidir}/tripleo_ansible/roles ANSIBLE_ROLES_PATH={toxinidir}/tripleo_ansible/roles.galaxy:{toxinidir}/tripleo_ansible/roles
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
ANSIBLE_NOCOWS=1 ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0 ANSIBLE_RETRY_FILES_ENABLED=0
@ -47,7 +47,8 @@ envdir = {toxworkdir}/linters
deps = deps =
{[testenv:linters]deps} {[testenv:linters]deps}
commands = commands =
bash -c "ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml" bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run ansible-lint -a python -m pre_commit run ansible-lint -a
[testenv:yamllint] [testenv:yamllint]

View File