Browse Source

Add missing doc & zuul job for tripleo_provision_mcelog

* Use become: true or the role can't be run as a regular user.
* Add the missing rst file that will generate the doc for the
  tripleo_provision_mcelog role.
* Add zuul layout to create the molecule job so we can test
  tripleo_provision_mcelog.
* Remove useless molecule/default/Dockerfile
* Update molecule/default/molecule.yml to match with other roles

Change-Id: I50efdfe02a3deec961f0a1fde473458ca6110698
changes/09/730409/4
Emilien Macchi 2 years ago
parent
commit
ed6893bd16
  1. 6
      doc/source/roles/role-tripleo_provision_mcelog.rst
  2. 37
      tripleo_ansible/roles/tripleo_provision_mcelog/molecule/default/Dockerfile
  3. 59
      tripleo_ansible/roles/tripleo_provision_mcelog/molecule/default/molecule.yml
  4. 2
      tripleo_ansible/roles/tripleo_provision_mcelog/tasks/main.yml
  5. 9
      zuul.d/molecule.yaml

6
doc/source/roles/role-tripleo_provision_mcelog.rst

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

37
tripleo_ansible/roles/tripleo_provision_mcelog/molecule/default/Dockerfile

@ -1,37 +0,0 @@
# Molecule managed
# Copyright 2020 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"]

59
tripleo_ansible/roles/tripleo_provision_mcelog/molecule/default/molecule.yml

@ -1,51 +1,50 @@
---
driver:
name: podman
name: delegated
options:
managed: false
login_cmd_template: >-
ssh
-o UserKnownHostsFile=/dev/null
-o StrictHostKeyChecking=no
-o Compression=no
-o TCPKeepAlive=yes
-o VerifyHostKeyDNS=no
-o ForwardX11=no
-o ForwardAgent=no
{instance}
ansible_connection_options:
ansible_connection: ssh
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') }}"
ulimits: &ulimit
- host
- 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
ulimits: *ulimit
- name: instance
provisioner:
name: ansible
config_options:
defaults:
fact_caching: jsonfile
fact_caching_connection: /tmp/molecule/facts
inventory:
hosts:
all:
hosts:
instance:
ansible_host: localhost
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH:-/usr/share/ansible/roles}:${HOME}/zuul-jobs/roles"
ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}"
ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}"
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- check
- verify
- destroy
verifier:
name: testinfra

2
tripleo_ansible/roles/tripleo_provision_mcelog/tasks/main.yml

@ -33,11 +33,13 @@
- always
- name: Ensure mcelog is installed
become: true
package:
name: mcelog
state: installed
- name: Ensure mcelog is enabled and started
become: true
systemd:
state: started
name: mcelog

9
zuul.d/molecule.yaml

@ -35,6 +35,7 @@
- tripleo-ansible-centos-8-molecule-tripleo_packages
- tripleo-ansible-centos-8-molecule-tripleo_persist
- tripleo-ansible-centos-8-molecule-tripleo_podman
- tripleo-ansible-centos-8-molecule-tripleo_provision_mcelog
- tripleo-ansible-centos-8-molecule-tripleo_ptp
- tripleo-ansible-centos-8-molecule-tripleo_puppet_cache
- tripleo-ansible-centos-8-molecule-tripleo_redhat_enforce
@ -81,6 +82,7 @@
- tripleo-ansible-centos-8-molecule-tripleo_packages
- tripleo-ansible-centos-8-molecule-tripleo_persist
- tripleo-ansible-centos-8-molecule-tripleo_podman
- tripleo-ansible-centos-8-molecule-tripleo_provision_mcelog
- tripleo-ansible-centos-8-molecule-tripleo_ptp
- tripleo-ansible-centos-8-molecule-tripleo_puppet_cache
- tripleo-ansible-centos-8-molecule-tripleo_redhat_enforce
@ -371,6 +373,13 @@
parent: tripleo-ansible-centos-8-base
vars:
tripleo_role_name: tripleo_podman
- job:
files:
- ^tripleo_ansible/roles/tripleo_provision_mcelog/.*
name: tripleo-ansible-centos-8-molecule-tripleo_provision_mcelog
parent: tripleo-ansible-centos-8-base
vars:
tripleo_role_name: tripleo_provision_mcelog
- job:
files:
- ^tripleo_ansible/roles/tripleo_ptp/.*

Loading…
Cancel
Save