mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Clean up test entries from sysrc tests (#2330)
* Clean up test entries from sysrc tests * sysrc: enable tests * sysrc: cache the files to be changed and restore them * Update the ezjail archive host and remove obsolete file * sysrc: set ezjail to use archives for 12.0 or less * sysrc: Detect the version to use ftp vs ftp-archive using http * sysrc: Skip ezjail test on FreeBSD 12.0
This commit is contained in:
parent
5064aa8ec6
commit
7007c68ab7
3 changed files with 28 additions and 3 deletions
|
@ -3,4 +3,3 @@ needs/root
|
|||
skip/docker
|
||||
skip/osx
|
||||
skip/rhel
|
||||
disabled # FIXME
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
block:
|
||||
- name: Cache original contents of /etc/rc.conf
|
||||
shell: "cat /etc/rc.conf"
|
||||
register: sysrc_original_content
|
||||
register: cached_etc_rcconf_content
|
||||
|
||||
- name: Cache original contents of /boot/loader.conf
|
||||
shell: "cat /boot/loader.conf"
|
||||
register: cached_boot_loaderconf_content
|
||||
|
||||
##
|
||||
## sysrc - example - set mysqlpidfile
|
||||
|
@ -130,6 +134,11 @@
|
|||
## sysrc - example - Enable nginx in testjail
|
||||
##
|
||||
- name: Test within jail
|
||||
#
|
||||
# NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are
|
||||
# only running this on 12.1 or higher
|
||||
#
|
||||
when: ansible_distribution_version is version('12.01', '>=')
|
||||
block:
|
||||
- name: Setup testjail
|
||||
include: setup-testjail.yml
|
||||
|
@ -316,3 +325,13 @@
|
|||
- not sysrc_value_absent_idempotent.changed
|
||||
- "'sysrc_delim=\"t1,t2\"' in sysrc_delim_content.stdout_lines"
|
||||
- "'sysrc_delim_delete' not in sysrc_delim_content.stdout_lines"
|
||||
always:
|
||||
- name: Restore /etc/rc.conf
|
||||
copy:
|
||||
content: "{{ cached_etc_rcconf_content }}"
|
||||
dest: /etc/rc.conf
|
||||
|
||||
- name: Restore /boot/loader.conf
|
||||
copy:
|
||||
content: "{{ cached_boot_loaderconf_content }}"
|
||||
dest: /boot/loader.conf
|
|
@ -17,12 +17,19 @@
|
|||
pkgng:
|
||||
name: ezjail
|
||||
|
||||
- name: Configure ezjail to use http
|
||||
when: ansible_distribution_version is version('11.01', '>')
|
||||
lineinfile:
|
||||
dest: /usr/local/etc/ezjail.conf
|
||||
regexp: ^ezjail_ftphost
|
||||
line: ezjail_ftphost=http://ftp.freebsd.org
|
||||
|
||||
- name: Configure ezjail to use archive for old freebsd releases
|
||||
when: ansible_distribution_version is version('11.01', '<=')
|
||||
lineinfile:
|
||||
dest: /usr/local/etc/ezjail.conf
|
||||
regexp: ^ezjail_ftphost
|
||||
line: ezjail_ftphost=ftp-archive.freebsd.org
|
||||
line: ezjail_ftphost=http://ftp-archive.freebsd.org
|
||||
|
||||
- name: Start ezjail
|
||||
ignore_errors: yes
|
||||
|
|
Loading…
Reference in a new issue