Merge "Introduce tripleo_ceph_client_files standalone Ansible role"

This commit is contained in:
Zuul 2022-12-16 21:23:54 +00:00 committed by Gerrit Code Review
commit 2c6f0e5fc2
10 changed files with 242 additions and 0 deletions

View File

@ -0,0 +1,6 @@
================================
Role - tripleo_ceph_client_files
================================
.. ansibleautoplugin::
:role: tripleo_ansible/roles/tripleo_ceph_client_files

View File

@ -0,0 +1,24 @@
---
# Copyright 2022 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.
# All variables intended for modification should be placed in this file.
# All variables within this role should have a prefix of "tripleo_ceph_client_files"
tripleo_ceph_client_files_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}"
tripleo_ceph_client_files_hide_sensitive_logs: true
tripleo_ceph_client_files_source: ""
tripleo_ceph_client_files_config_home: "{{ tripleo_ceph_client_config_home | default('/var/lib/tripleo-config/ceph/') }}"

View File

@ -0,0 +1,15 @@
---
# Copyright 2022 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.

View File

@ -0,0 +1,43 @@
---
# Copyright 2022 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_client_files
company: Red Hat
license: Apache-2.0
min_ansible_version: 2.7
namespace: openstack
#
# 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: CentOS
versions:
- 8
- 9
galaxy_tags:
- tripleo
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []

View File

@ -0,0 +1,23 @@
---
# Copyright 2022 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_client_files"
vars:
tripleo_ceph_client_files_source: "/home/stack/ceph_files/"

View File

@ -0,0 +1,28 @@
---
driver:
name: podman
provisioner:
inventory:
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
name: ansible
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- check
- verify
- destroy
verifier:
name: testinfra

View File

@ -0,0 +1,22 @@
---
# Copyright 2022 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
- role: env_data

View File

@ -0,0 +1,48 @@
---
# Copyright 2022 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: Fail if tripleo_ceph_client_files_source is missing
fail:
msg: >-
tripleo_ceph_client_files_source must be set to a path that
already exists on the Ansible host which contains Ceph
configuration and Cephx key files.
when:
- tripleo_ceph_client_files_source is not defined or
(tripleo_ceph_client_files_source is defined and
tripleo_ceph_client_files_source | length < 1)
- name: Get list ceph files to copy from localhost tripleo_ceph_client_files_source
delegate_to: localhost
become: true
set_fact:
tripleo_ceph_client_dist: "{{ lookup('fileglob',
tripleo_ceph_client_files_source ~ '/*',
wantlist=True) | list }}"
- name: Ensure tripleo_ceph_client_config_home exists on all hosts
file:
path: "{{ tripleo_ceph_client_files_config_home }}"
state: directory
become: true
- name: Push files from tripleo_ceph_client_files_source to all hosts
become: true
copy:
src: "{{ item }}"
dest: "{{ tripleo_ceph_client_files_config_home }}/{{ item | basename }}"
mode: "{{ '600' if item | regex_search('.*.keyring$') else '644' }}"
loop: "{{ tripleo_ceph_client_dist }}"

View File

@ -0,0 +1,22 @@
---
# Copyright 2022 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.
# While options found within the vars/ path can be overridden using extra
# vars, items within this path are considered part of the role and not
# intended to be modified.
# All variables within this role should have a prefix of "tripleo_ceph_client_files"

View File

@ -17,6 +17,7 @@
- tripleo-ansible-centos-stream-molecule-tripleo_bootstrap
- tripleo-ansible-centos-stream-molecule-tripleo_cellv2
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client_files
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_distribute_keys
- tripleo-ansible-centos-stream-molecule-tripleo_cephadm
- tripleo-ansible-centos-stream-molecule-tripleo_clients_install
@ -95,6 +96,7 @@
- tripleo-ansible-centos-stream-molecule-tripleo_bootstrap
- tripleo-ansible-centos-stream-molecule-tripleo_cellv2
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client_files
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_distribute_keys
- tripleo-ansible-centos-stream-molecule-tripleo_cephadm
- tripleo-ansible-centos-stream-molecule-tripleo_clients_install
@ -173,6 +175,7 @@
- tripleo-ansible-centos-stream-molecule-tripleo_bootstrap
- tripleo-ansible-centos-stream-molecule-tripleo_cellv2
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_client_files
- tripleo-ansible-centos-stream-molecule-tripleo_ceph_distribute_keys
- tripleo-ansible-centos-stream-molecule-tripleo_cephadm
- tripleo-ansible-centos-stream-molecule-tripleo_clients_install
@ -346,6 +349,14 @@
vars:
tripleo_job_ansible_args: --skip-tags=ceph_client_rsync,clean_fetch_dir
tripleo_role_name: tripleo_ceph_client
- job:
files:
- ^molecule-requirements.txt
- ^tripleo_ansible/roles/tripleo_ceph_client_files/(?!meta).*
name: tripleo-ansible-centos-stream-molecule-tripleo_ceph_client_files
parent: tripleo-ansible-centos-stream-base
vars:
tripleo_role_name: tripleo_ceph_client_files
- job:
files:
- ^molecule-requirements.txt