From d528daf069559c3686f05a26f9b4d68c84a34b77 Mon Sep 17 00:00:00 2001 From: Cameron Loader Date: Tue, 22 Jan 2019 10:43:15 +0000 Subject: [PATCH] Fix ceph-ansible role-requirements 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 --- ansible-role-requirements.yml | 16 ++-------------- .../notes/role-git-clone-5e3c11a3005f55eb.yaml | 16 ++++++++++++++++ scripts/bootstrap-ansible.sh | 2 +- scripts/gate-check-commit.sh | 4 ---- scripts/openstack-ansible.rc | 2 +- tox.ini | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 releasenotes/notes/role-git-clone-5e3c11a3005f55eb.yaml diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index 5503991fd2..0c8e072be7 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -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 diff --git a/releasenotes/notes/role-git-clone-5e3c11a3005f55eb.yaml b/releasenotes/notes/role-git-clone-5e3c11a3005f55eb.yaml new file mode 100644 index 0000000000..266d35a9df --- /dev/null +++ b/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. diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index fb6e667227..c6db1c3b47 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -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}")/.." diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index ca5f20d7f1..3005e6052a 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -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"} diff --git a/scripts/openstack-ansible.rc b/scripts/openstack-ansible.rc index 27d05bf7c2..6816ae9ae6 100644 --- a/scripts/openstack-ansible.rc +++ b/scripts/openstack-ansible.rc @@ -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}" diff --git a/tox.ini b/tox.ini index 837202948e..b8dc5c2bf5 100644 --- a/tox.ini +++ b/tox.ini @@ -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]