Skip to content

Commit

Permalink
Fix ceph-ansible role-requirements
Browse files Browse the repository at this point in the history
Ceph has removed the individual repos of common, osds, mons, defaults...
this uses the new combined ceph-ansible repo.

Using the combined ceph-ansible repo breaks ansible-galaxy (because
ceph-ansible is not a role), so we also need to switch the default for
the ansible bootstrap to use git instead, and we need to adjust the lint
test to use git instead of ansible-galaxy.

Change-Id: I73141e9b4ef4cfa83b9ad3c434be91a270ecc99a
  • Loading branch information
Cameron Loader authored and Jesse Pretorius committed Jan 22, 2019
1 parent 32de1f0 commit d528daf
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
16 changes: 2 additions & 14 deletions ansible-role-requirements.yml
Expand Up @@ -170,19 +170,7 @@
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_designate
version: 4c7d75e71c894040e9222816d29bb4831512af94
- name: ceph.ceph-common
- name: ceph-ansible
scm: git
src: https://github.com/ceph/ansible-ceph-common
version: v2.2.9
- name: ceph.ceph-docker-common
scm: git
src: https://github.com/ceph/ansible-ceph-docker-common
version: ca86fd0ef6d24aa2c750a625acdcb8012c374aa0
- name: ceph-mon
scm: git
src: https://github.com/ceph/ansible-ceph-mon
version: v2.2.9
- name: ceph-osd
scm: git
src: https://github.com/ceph/ansible-ceph-osd
src: https://github.com/ceph/ceph-ansible
version: v2.2.9
16 changes: 16 additions & 0 deletions releasenotes/notes/role-git-clone-5e3c11a3005f55eb.yaml
@@ -0,0 +1,16 @@
---
upgrade:
- |
The default method for download roles has been switched from ``galaxy`` to
``git-clone``. This has no functional effect, but is now required in order
to successfully download the ``ceph-ansible`` repository. In order to
prevent clashes between the old and new roles, the existing
``/etc/ansible/roles/ceph*`` folders should be removed prior to running
``scripts/bootstrap-ansible.sh`` during the minor upgrade process.
fixes:
- |
The ``ceph-ansible`` individual role repositories were all removed from
github on around 16 January 2019, causing the bootstrap-ansible script to
fail for any new deployments, or during upgrades for environments which
had these roles previously. To replace them, the ``ceph-ansible`` git
repository is used instead.
2 changes: 1 addition & 1 deletion scripts/bootstrap-ansible.sh
Expand Up @@ -28,7 +28,7 @@ export SSH_DIR=${SSH_DIR:-"/root/.ssh"}
export DEBIAN_FRONTEND=${DEBIAN_FRONTEND:-"noninteractive"}

# Set the role fetch mode to any option [galaxy, git-clone]
export ANSIBLE_ROLE_FETCH_MODE=${ANSIBLE_ROLE_FETCH_MODE:-galaxy}
export ANSIBLE_ROLE_FETCH_MODE=${ANSIBLE_ROLE_FETCH_MODE:-git-clone}

# This script should be executed from the root directory of the cloned repo
cd "$(dirname "${0}")/.."
Expand Down
4 changes: 0 additions & 4 deletions scripts/gate-check-commit.sh
Expand Up @@ -37,10 +37,6 @@ export TERM=linux
# function at the end of the run.
export OSA_GATE_JOB=true

# Set the role fetch mode to git-clone to avoid interactions
# with the Ansible galaxy API.
export ANSIBLE_ROLE_FETCH_MODE="git-clone"

# Set the scenario to execute based on the first CLI parameter
export SCENARIO=${1:-"aio"}

Expand Down
2 changes: 1 addition & 1 deletion scripts/openstack-ansible.rc
Expand Up @@ -19,7 +19,7 @@ export ANSIBLE_INVENTORY="${ANSIBLE_INVENTORY:-OSA_INVENTORY_PATH}"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-/openstack/log/ansible-logging/ansible.log}"
mkdir -p "$(dirname ${ANSIBLE_LOG_PATH})" || unset ANSIBLE_LOG_PATH

export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH:-/etc/ansible/roles:OSA_PLAYBOOK_PATH/roles}"
export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH:-/etc/ansible/roles:OSA_PLAYBOOK_PATH/roles:/etc/ansible/roles/ceph-ansible/roles}"

export ANSIBLE_LIBRARY="${ANSIBLE_LIBRARY:-/etc/ansible/roles/plugins/library}"
export ANSIBLE_LOOKUP_PLUGINS="${ANSIBLE_LOOKUP_PLUGINS:-/etc/ansible/roles/plugins/lookup}"
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Expand Up @@ -103,12 +103,12 @@ setenv =
ANSIBLE_FILTER_PLUGINS = {homedir}/.ansible/roles/plugins/filter
ANSIBLE_LOOKUP_PLUGINS = {homedir}/.ansible/roles/plugins/lookup
ANSIBLE_LIBRARY = {homedir}/.ansible/roles/plugins/library
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/playbooks/roles
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/playbooks/roles:{homedir}/.ansible/roles/ceph-ansible/roles
commands =
rm -rf {homedir}/.ansible/roles
ansible-galaxy install \
--role-file={toxinidir}/ansible-role-requirements.yml \
--force
ansible-playbook {toxinidir}/tests/get-ansible-role-requirements.yml \
-e role_file={toxinidir}/ansible-role-requirements.yml \
-e role_path_default={homedir}/.ansible/roles


[testenv:ansible-lint]
Expand Down

0 comments on commit d528daf

Please sign in to comment.