Browse Source
The state information in the ceph-ansible fetch directory is no longer necessary to replace a Ceph monitor as of ceph-ansible 4.0.14-1. Stein, Train, Ussuri and newer should be using this version of ceph-ansible or newer. TripleO does not need to do extra work to maintain the fetch directory. Remove tripleo_ceph_fetch_dir role and modify code flow so that it's no longer used. Also, remove unnecessary dependencies in tripleo-ceph-* roles as described in LP #1844837. Change-Id: Ic292dcc1bcf1e7575285ad56d56df2966e968b6d Depends-On: I3f8c2571a6dd35029d71dd42df637a962d9b3235 Related-Bug: #1863809 Closes-Bug: #1844837changes/50/709250/4
19 changed files with 38 additions and 440 deletions
@ -1 +0,0 @@
|
||||
tripleo_ceph_fetch_dir |
@ -1,17 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
calling_ansible_environment_variables: [] |
@ -1,47 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
galaxy_info: |
||||
author: OpenStack |
||||
description: TripleO OpenStack Role -- tripleo_ceph_fetch_dir |
||||
company: Red Hat |
||||
license: Apache-2.0 |
||||
min_ansible_version: 2.7 |
||||
# |
||||
# Provide a list of supported platforms, and for each platform a list of versions. |
||||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. |
||||
# To view available platforms and versions (or releases), visit: |
||||
# https://galaxy.ansible.com/api/v1/platforms/ |
||||
# |
||||
platforms: |
||||
- name: Fedora |
||||
versions: |
||||
- 28 |
||||
- name: CentOS |
||||
versions: |
||||
- 7 |
||||
|
||||
galaxy_tags: |
||||
- tripleo |
||||
|
||||
dependencies: |
||||
- role: tripleo_ceph_common |
||||
when: |
||||
- ceph_common_done is undefined |
||||
- role: tripleo_ceph_work_dir |
||||
when: |
||||
- ceph_ansible_private_key_file is undefined |
@ -1,37 +0,0 @@
|
||||
# Molecule managed |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
{% if item.registry is defined %} |
||||
FROM {{ item.registry.url }}/{{ item.image }} |
||||
{% else %} |
||||
FROM {{ item.image }} |
||||
{% endif %} |
||||
|
||||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ |
||||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \ |
||||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ |
||||
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \ |
||||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \ |
||||
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi |
||||
|
||||
{% for pkg in item.easy_install | default([]) %} |
||||
# install pip for centos where there is no python-pip rpm in default repos |
||||
RUN easy_install {{ pkg }} |
||||
{% endfor %} |
||||
|
||||
|
||||
CMD ["sh", "-c", "while true; do sleep 10000; done"] |
@ -1,52 +0,0 @@
|
||||
--- |
||||
driver: |
||||
name: docker |
||||
|
||||
log: true |
||||
|
||||
platforms: |
||||
- name: centos7 |
||||
hostname: centos7 |
||||
image: centos:7 |
||||
dockerfile: Dockerfile |
||||
pkg_extras: python-setuptools |
||||
volumes: |
||||
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro |
||||
easy_install: |
||||
- pip |
||||
environment: &env |
||||
http_proxy: "{{ lookup('env', 'http_proxy') }}" |
||||
https_proxy: "{{ lookup('env', 'https_proxy') }}" |
||||
|
||||
- name: centos8 |
||||
hostname: centos8 |
||||
image: centos:8 |
||||
dockerfile: Dockerfile |
||||
pkg_extras: python*-setuptools |
||||
volumes: |
||||
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro |
||||
environment: |
||||
<<: *env |
||||
|
||||
provisioner: |
||||
name: ansible |
||||
inventory: |
||||
hosts: |
||||
all: |
||||
vars: |
||||
ansible_user: root |
||||
log: true |
||||
env: |
||||
ANSIBLE_STDOUT_CALLBACK: yaml |
||||
|
||||
scenario: |
||||
test_sequence: |
||||
- destroy |
||||
- create |
||||
- prepare |
||||
- converge |
||||
- verify |
||||
- destroy |
||||
|
||||
verifier: |
||||
name: testinfra |
@ -1,21 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
- name: Converge |
||||
hosts: all |
||||
roles: |
||||
- role: "tripleo_ceph_fetch_dir" |
@ -1,21 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
- name: Prepare |
||||
hosts: all |
||||
roles: |
||||
- role: test_deps |
@ -1,15 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
@ -1,68 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
- name: register contents of fetch_directory after ceph-ansible run |
||||
find: |
||||
paths: "{{ playbook_dir }}/ceph-ansible/fetch_dir/" |
||||
recurse: true |
||||
register: ceph_ansible_fetch_dir_contents |
||||
|
||||
# backup to local directory |
||||
- name: create ceph-ansible fetch directory tarball in local backup |
||||
archive: |
||||
path: "{{ playbook_dir }}/ceph-ansible/fetch_dir/*" |
||||
dest: "{{ local_ceph_ansible_fetch_directory_backup }}/{{ ceph_ansible_tarball_name }}" |
||||
exclude_path: |
||||
- '{{ playbook_dir }}/ceph-ansible/fetch_dir/fetch_dir' |
||||
when: |
||||
- local_ceph_ansible_fetch_directory_backup | length > 0 |
||||
- ceph_ansible_fetch_dir_contents.matched|int != 0 |
||||
|
||||
# backup to swift |
||||
- when: |
||||
- local_ceph_ansible_fetch_directory_backup | length == 0 |
||||
- ceph_ansible_fetch_dir_contents.matched|int != 0 |
||||
block: |
||||
- name: create temporary ceph-ansible fetch directory tarball for swift backup |
||||
archive: |
||||
path: "{{ playbook_dir }}/ceph-ansible/fetch_dir/*" |
||||
dest: "/tmp/{{ new_ceph_ansible_tarball_name }}" |
||||
exclude_path: |
||||
- '{{ playbook_dir }}/ceph-ansible/fetch_dir/fetch_dir' |
||||
- name: backup temporary ceph-ansible fetch directory tarball in swift |
||||
shell: "curl -s -o /dev/null -w '%{http_code}' -X PUT -T /tmp/{{ new_ceph_ansible_tarball_name }} \"{{ swift_put_url }}\"" |
||||
register: curl_put_http_status |
||||
- fail: |
||||
msg: 'Received HTTP: {{ curl_put_http_status.stdout }} when attempting to PUT to {{ swift_put_url }}' |
||||
name: ensure we were able to backup temporary fetch directory to swift |
||||
when: |
||||
- curl_put_http_status is changed |
||||
- curl_put_http_status.stdout != "200" |
||||
- curl_put_http_status.stdout != "201" |
||||
- name: clean temporary fetch directory after swift backup |
||||
file: |
||||
path: "/tmp/{{ new_ceph_ansible_tarball_name }}" |
||||
state: absent |
||||
when: (curl_put_http_status is changed and |
||||
(curl_put_http_status.stdout == "200" or |
||||
curl_put_http_status.stdout == "201")) |
||||
|
||||
# remove copy of fetchdir in case another user unpacks it (LP #1823229) |
||||
- name: Remove ceph-ansible fetch directory |
||||
become: true |
||||
file: |
||||
path: "{{ playbook_dir }}/ceph-ansible/fetch_dir/" |
||||
state: absent |
@ -1,93 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
# local backup |
||||
- when: local_ceph_ansible_fetch_directory_backup | length > 0 |
||||
block: |
||||
- name: look for requested ceph-ansible fetch directory for local backup |
||||
stat: path="{{ local_ceph_ansible_fetch_directory_backup }}" |
||||
register: local_backup_directory |
||||
ignore_errors: true |
||||
- name: fail if ansible does not have necessary permissions on local_backup_directory |
||||
fail: |
||||
msg: >- |
||||
The user running Ansible needs to be able to read and write to |
||||
the '{{ local_ceph_ansible_fetch_directory_backup }}' directory. |
||||
Please set the LocalCephAnsibleFetchDirectoryBackup Heat parameter or |
||||
the local_ceph_ansible_fetch_directory_backup Ansible parameter to a |
||||
directory the user '{{ lookup('env','USER') }}' can read and write to. |
||||
when: |
||||
- (local_backup_directory.msg is defined and |
||||
local_backup_directory.msg == "Permission denied") |
||||
or |
||||
(local_backup_directory.stat is defined and |
||||
local_backup_directory.stat.exists and |
||||
not local_backup_directory.stat.writeable) |
||||
- name: autocreate new directory for ceph-ansible fetch directory backup |
||||
become: true |
||||
file: |
||||
path: "{{ local_ceph_ansible_fetch_directory_backup }}" |
||||
state: directory |
||||
owner: "{{ ansible_user }}" |
||||
mode: 0700 |
||||
when: |
||||
- local_backup_directory.stat is defined |
||||
- not local_backup_directory.stat.exists |
||||
- name: look for tarball of ceph-ansible fetch directory in local backup |
||||
stat: path="{{ local_ceph_ansible_fetch_directory_backup }}/{{ ceph_ansible_tarball_name }}" |
||||
register: local_backup_file |
||||
ignore_errors: true |
||||
- name: untar local backup of ceph-ansible fetch directory |
||||
# unarchive module hit https://github.com/ansible/ansible/issues/35645 |
||||
shell: >- |
||||
/usr/bin/gtar --gzip --extract --file \ |
||||
{{ local_ceph_ansible_fetch_directory_backup }}/{{ ceph_ansible_tarball_name }} \ |
||||
-C {{ playbook_dir }}/ceph-ansible/fetch_dir |
||||
when: |
||||
- local_backup_file.stat is defined |
||||
- local_backup_file.stat.exists |
||||
|
||||
# swift backup |
||||
- when: local_ceph_ansible_fetch_directory_backup | length == 0 |
||||
block: |
||||
- name: attempt download of fetch directory tarball from swift backup |
||||
shell: "curl -s -o /tmp/{{ old_ceph_ansible_tarball_name }} -w '%{http_code}' -X GET \"{{ swift_get_url }}\"" |
||||
register: curl_get_http_status |
||||
ignore_errors: true |
||||
- name: ensure we create a new fetch_directory or use the old fetch_directory |
||||
fail: |
||||
msg: "Received HTTP: {{ curl_get_http_status.stdout }} when attempting to GET from {{ swift_get_url }}" |
||||
when: |
||||
- curl_get_http_status is changed |
||||
- curl_get_http_status.stdout != "200" # deployment update |
||||
- curl_get_http_status.stdout != "404" # new deployment |
||||
- name: unpack downloaded ceph-ansible fetch tarball to fetch directory |
||||
# unarchive module hit https://github.com/ansible/ansible/issues/35645 |
||||
shell: "/usr/bin/gtar --gzip --extract --file /tmp/{{ old_ceph_ansible_tarball_name }} -C {{ playbook_dir }}/ceph-ansible/fetch_dir" |
||||
when: |
||||
- curl_get_http_status is changed |
||||
- curl_get_http_status.stdout == "200" |
||||
- name: remove downloaded ceph-ansible fetch directory tarball from filesystem |
||||
file: |
||||
path: "/tmp/{{ old_ceph_ansible_tarball_name }}" |
||||
state: absent |
||||
when: |
||||
- curl_get_http_status is changed |
||||
- curl_get_http_status.stdout == "200" |
||||
|
||||
- name: Set cleaned fact |
||||
set_fact: |
||||
ceph_node_cleaned: true |
@ -1,17 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
- import_tasks: create.yml |
@ -1,19 +0,0 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
ceph_ansible_tarball_name: 'temporary_dir.tar.gz' |
||||
old_ceph_ansible_tarball_name: 'temporary_dir_old.tar.gz' |
||||
new_ceph_ansible_tarball_name: 'temporary_dir_new.tar.gz' |
Loading…
Reference in new issue