1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/monit/tasks/main.yml
patchback[bot] ab5143b15d
Add RHEL 9.0, FreeBSD 13.1, Ubuntu 22.04 and Fedora 36 to CI, fix bug in filesystem module (#4700) (#4710)
* Add RHEL 9.0 and FreeBSD 13.1 to CI.

* RHEL 9 has no pyOpenSSL apparently.

* Adjust URL for EPEL.

* Fix cargo install on FreeBSD 13.1.

* Add Ubuntu 22.04 and Fedora 36 to CI.

* Fix logic.

* filesystem: do not die output line does not contain ':'

* Skip django_manage tests on RHEL 9 as well.

* homectl tests don't work with RHEL 9.0.

* Improve error handling, improve fatresize output handling.

* Skip Fedora 36.

* Skip filesystem vfat tests on Ubuntu 22.04.

There, resizing fails with a bug:
Bug: Assertion (disk != NULL) at ../../libparted/disk.c:1620 in function ped_disk_get_partition_by_sector() failed.

* 'trusty' is 14.04. Adding 22.04 to skip list.

* Skip jail tests for FreeBSD 13.1.

* Add config for postgres on Ubuntu 22.04.

* Make CentOS 6 happy.

* Adjust postgres version.

* Try installing EPEL a bit differently.

* Skip ufw and iso_extract tests on RHEL 9.

* Skip odbc tests on RHEL 9.

* Skip RHEL 9.0 for snap tests.

* Add changelog fragment for filesystem code changes.

(cherry picked from commit 319c29c2a2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-22 17:48:34 +02:00

93 lines
2.1 KiB
YAML

####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
- block:
- name: Install EPEL repository (RHEL only)
include_role:
name: setup_epel
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version is version('9', '<')
- name: create required directories
become: yes
file:
path: "{{ item }}"
state: directory
loop:
- /var/lib/monit
- /var/run/monit
- "{{ process_root }}"
- name: install monit
become: yes
package:
name: monit
state: present
- include_vars: '{{ item }}'
with_first_found:
- files:
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
- '{{ ansible_os_family }}.yml'
- 'defaults.yml'
- name: monit config
become: yes
template:
src: "monitrc.j2"
dest: "{{ monitrc }}"
- name: copy process file
become: yes
copy:
src: httpd_echo.py
dest: "{{ process_file }}"
- name: Install virtualenv
package:
name: virtualenv
state: present
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install virtualenv
package:
name: python-virtualenv
state: present
when: ansible_os_family == 'Archlinux'
- name: install dependencies
pip:
name: "{{ item }}"
virtualenv: "{{ process_venv }}"
loop:
- setuptools==44
- python-daemon
- name: restart monit
become: yes
service:
name: monit
state: restarted
- include_tasks: test.yml
always:
- name: stop monit
become: yes
service:
name: monit
state: stopped
- name: uninstall monit
become: yes
package:
name: monit
state: absent
- name: remove process files
file:
path: "{{ process_root }}"
state: absent