This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shared configuration for all molecule test
This patch adds a molecule configuration file at the repository level (tripleo-validations/.config/molecule/config.yml) which defines all the default values for molecule.yml files in all roles. This patch also introduces a common Dockerfile (UBI8 image) shared between all the role molecule tests. This Dockerfile will install the CentOS 8.x Linux Repos and GPG Keys during the image build. This Dockerfile is located in tripleo-validations/.config/molecule directory and it is shared through a relative symbolic link between all the molecule directories. NOTE: tox-ansible doesn't manage shared molecule configuration at the project level (see [1]). To be able to use it, we have to explicitly add the driver name in each molecule.yml file in the roles level. Once [1] will be fixed, these will be removed. [1] - ansible/tox-ansible#88). Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd (cherry picked from commit 66193a6) (cherry picked from commit 6a3081b) (cherry picked from commit 8bd52a2) (cherry picked from commit f2f322c1ea195905d080b303a0e97c905f9592f3)
- Loading branch information
Showing
110 changed files
with
347 additions
and
4,228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Molecule managed | ||
# Copyright 2021 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 dnf makecache && dnf install -y sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }} | ||
# TODO(gchamoul): find a better to get always the latest version of those rpms | ||
# below from the centos mirror | ||
RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm | ||
RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm && dnf install -y epel-release && dnf clean all | ||
|
||
{% 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
# Tripleo-validations uses a shared molecule configuration file to avoid | ||
# repetition. That configuration file is located at the repository level | ||
# ({REPO}/.config/molecule/config.yml) and defines all the default values for | ||
# all the molecule.yml files across all the roles. By default, the role-addition | ||
# process will produce an empty molecule.yml inheriting this config.yml file. | ||
# | ||
# Any key defined in the role molecule.yml file will override values from this | ||
# config.yml file. | ||
# | ||
# IMPORTANT: if you want to override the default values set here in this file, | ||
# you will have to redefine them completely in your molecule.yml (at the role | ||
# level) and add your extra configuration! | ||
# | ||
# For instance, if you need to add an extra package in your ubi8 container, you | ||
# will have to add the entire "platforms" key into your molecule.yml file and | ||
# add your package name in the pkg_extras key. | ||
# | ||
# No merge will happen between your molecule.yml and this config.yml | ||
# files. That's why you will have to redefine them completely. | ||
|
||
driver: | ||
name: podman | ||
|
||
log: true | ||
|
||
platforms: | ||
- name: ubi8 | ||
hostname: ubi8 | ||
image: ubi8/ubi-init | ||
registry: | ||
url: registry.access.redhat.com | ||
dockerfile: Dockerfile | ||
pkg_extras: python*-setuptools python*-pyyaml | ||
volumes: | ||
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro | ||
privileged: true | ||
environment: &env | ||
http_proxy: "{{ lookup('env', 'http_proxy') }}" | ||
https_proxy: "{{ lookup('env', 'https_proxy') }}" | ||
ulimits: &ulimit | ||
- host | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
hosts: | ||
all: | ||
hosts: | ||
ubi8: | ||
ansible_python_interpreter: /usr/bin/python3 | ||
log: true | ||
options: | ||
vvv: true | ||
env: | ||
ANSIBLE_STDOUT_CALLBACK: yaml | ||
ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" | ||
ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" | ||
|
||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- verify | ||
- destroy | ||
|
||
verifier: | ||
name: testinfra |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,6 @@ | ||
--- | ||
# inherits tripleo-validations/.config/molecule/config.yml | ||
# To override default values, please take a look at the config.yml. | ||
|
||
driver: | ||
name: podman | ||
|
||
log: true | ||
|
||
platforms: | ||
- name: ubi8 | ||
hostname: ubi8 | ||
image: ubi8/ubi-init | ||
registry: | ||
url: registry.access.redhat.com | ||
dockerfile: Dockerfile | ||
pkg_extras: python*-setuptools | ||
privileged: true | ||
volumes: | ||
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro | ||
- /etc/pki/rpm-gpg:/etc/pki/rpm-gpg | ||
- /opt/yum.repos.d:/etc/yum.repos.d:rw | ||
environment: &env | ||
http_proxy: "{{ lookup('env', 'http_proxy') }}" | ||
https_proxy: "{{ lookup('env', 'https_proxy') }}" | ||
ulimits: &ulimit | ||
- host | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
hosts: | ||
all: | ||
hosts: | ||
ubi8: | ||
ansible_python_interpreter: /usr/bin/python3 | ||
log: true | ||
env: | ||
ANSIBLE_STDOUT_CALLBACK: yaml | ||
ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" | ||
|
||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- verify | ||
- destroy | ||
|
||
verifier: | ||
name: testinfra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,6 @@ | ||
--- | ||
# inherits tripleo-validations/.config/molecule/config.yml | ||
# To override default values, please take a look at the config.yml. | ||
|
||
driver: | ||
name: podman | ||
|
||
log: true | ||
|
||
platforms: | ||
- name: ubi8 | ||
hostname: ubi8 | ||
image: ubi8/ubi-init | ||
registry: | ||
url: registry.access.redhat.com | ||
dockerfile: Dockerfile | ||
pkg_extras: python*-setuptools ruby python*-pyyaml | ||
volumes: | ||
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro | ||
- /etc/pki/rpm-gpg:/etc/pki/rpm-gpg | ||
- /opt/yum.repos.d:/etc/yum.repos.d:rw | ||
environment: &env | ||
http_proxy: "{{ lookup('env', 'http_proxy') }}" | ||
https_proxy: "{{ lookup('env', 'https_proxy') }}" | ||
ulimits: &ulimit | ||
- host | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
hosts: | ||
all: | ||
hosts: | ||
ubi8: | ||
ansible_python_interpreter: /usr/bin/python3 | ||
log: true | ||
env: | ||
ANSIBLE_STDOUT_CALLBACK: yaml | ||
ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" | ||
|
||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- verify | ||
- destroy | ||
|
||
verifier: | ||
name: testinfra |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../.config/molecule/Dockerfile |
Oops, something went wrong.