Replace all references to the old role name
This change replaces all of the roles references in our various files with the new role name. This is being done because Ansible no longer allows hyphens in role names. TODO: (gchamoul) Remove healthcheck-service-status once this patch is merged. Tripleo Jobs are RED due to THT trying to execute this validation as inflight one but it has been renamed healthcheck_service_status. Co-Authored-by: Gael Chamoulaud <gchamoul@redhat.com> Change-Id: I19bb587ece403f86ddd0bbe174c282326500cfd3
This commit is contained in:
committed by
Gael Chamoulaud (Strider)
parent
60851c8447
commit
ceb0f75182
3
roles/controller_ulimits/defaults/main.yml
Normal file
3
roles/controller_ulimits/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
nofiles_min: 1024
|
||||
nproc_min: 2048
|
||||
37
roles/controller_ulimits/molecule/default/Dockerfile.j2
Normal file
37
roles/controller_ulimits/molecule/default/Dockerfile.j2
Normal file
@@ -0,0 +1,37 @@
|
||||
# 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 python 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"]
|
||||
49
roles/controller_ulimits/molecule/default/molecule.yml
Normal file
49
roles/controller_ulimits/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
driver:
|
||||
name: docker
|
||||
log: true
|
||||
|
||||
platforms:
|
||||
- name: centos7
|
||||
ulimits: &ulimits
|
||||
- nofile:512:512
|
||||
- nproc:512:512
|
||||
hostname: centos7
|
||||
image: centos:7
|
||||
pkg_extras: python-setuptools
|
||||
easy_install:
|
||||
- pip
|
||||
environment: &env
|
||||
http_proxy: "{{ lookup('env', 'http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env', 'https_proxy') }}"
|
||||
|
||||
- name: fedora28
|
||||
ulimits: *ulimits
|
||||
hostname: fedora28
|
||||
image: fedora:28
|
||||
pkg_extras: python*-setuptools
|
||||
environment:
|
||||
<<: *env
|
||||
|
||||
provisioner:
|
||||
name: ansible
|
||||
log: true
|
||||
env:
|
||||
ANSIBLE_STDOUT_CALLBACK: yaml
|
||||
|
||||
scenario:
|
||||
test_sequence:
|
||||
- destroy
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
- verify
|
||||
- destroy
|
||||
|
||||
lint:
|
||||
enabled: false
|
||||
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
43
roles/controller_ulimits/molecule/default/playbook.yml
Normal file
43
roles/controller_ulimits/molecule/default/playbook.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
# 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
|
||||
gather_facts: false
|
||||
|
||||
vars:
|
||||
nofiles_min: 102400
|
||||
nproc_min: 204800
|
||||
|
||||
tasks:
|
||||
- block:
|
||||
- include_role:
|
||||
name: controller_ulimits
|
||||
rescue:
|
||||
- name: Clear host errors
|
||||
meta: clear_host_errors
|
||||
|
||||
- debug:
|
||||
msg: The validation works! End the playbook run
|
||||
|
||||
- name: End play
|
||||
meta: end_play
|
||||
|
||||
- name: Fail the test
|
||||
fail:
|
||||
msg: |
|
||||
The controller-ulimits failed detecting bad limits
|
||||
28
roles/controller_ulimits/tasks/main.yml
Normal file
28
roles/controller_ulimits/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Get nofiles limit
|
||||
become: true
|
||||
# NOTE: `ulimit` is a shell builtin so we have to invoke it like this:
|
||||
command: sh -c "ulimit -n"
|
||||
register: nofilesval
|
||||
changed_when: false
|
||||
|
||||
- name: Check nofiles limit
|
||||
fail:
|
||||
msg: >
|
||||
nofiles is set to {{ nofilesval.stdout }}. It should be at least
|
||||
{{ nofiles_min }} or higher, depending on available resources.
|
||||
failed_when: "nofilesval.stdout|int < nofiles_min"
|
||||
|
||||
- name: Get nproc limit
|
||||
become: true
|
||||
# NOTE: `ulimit` is a shell builtin so we have to invoke it like this:
|
||||
command: sh -c "ulimit -u"
|
||||
register: nprocval
|
||||
changed_when: false
|
||||
|
||||
- name: Check nproc limit
|
||||
fail:
|
||||
msg: >
|
||||
nproc is set to {{ nprocval.stdout }}. It should be at least
|
||||
{{ nproc_min }} or higher, depending on available resources.
|
||||
failed_when: "nprocval.stdout|int < nproc_min"
|
||||
7
roles/controller_ulimits/vars/main.yml
Normal file
7
roles/controller_ulimits/vars/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
metadata:
|
||||
name: Check controller ulimits
|
||||
description: >
|
||||
This will check the ulimits of each controller.
|
||||
groups:
|
||||
- post-deployment
|
||||
Reference in New Issue
Block a user