mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
pkgng: test jail creation logging less verbose
`ezjail-admin` had been spewing every filename copied into the jail onto stderr, making the `ansible-test -v` logs hard to scroll through. Changed it so that ezjail output only shows up in the ansible task logs if `ansible_verbosity > 1` (`-vv...`). Full `ezjail-admin` output is always logged to `/tmp/ezjail.log`.
This commit is contained in:
parent
a803240941
commit
406683383e
1 changed files with 6 additions and 2 deletions
|
@ -51,6 +51,10 @@
|
|||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: Redirect logs depending on verbosity
|
||||
set_fact:
|
||||
pkgng_jail_log_redirect: "2>&1 | tee -a /tmp/ezjail.log {{ '> /dev/null' if ansible_verbosity < 2 else '' }}"
|
||||
|
||||
- name: Has ezjail
|
||||
register: ezjail_base_jail
|
||||
stat:
|
||||
|
@ -58,7 +62,7 @@
|
|||
|
||||
- name: Setup ezjail base
|
||||
when: not ezjail_base_jail.stat.exists
|
||||
shell: "ezjail-admin install >> /tmp/ezjail.log"
|
||||
shell: "ezjail-admin install {{ pkgng_jail_log_redirect }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Has testjail
|
||||
|
@ -68,7 +72,7 @@
|
|||
|
||||
- name: Create testjail
|
||||
when: not ezjail_test_jail.stat.exists
|
||||
shell: "ezjail-admin create testjail 'lo1|127.0.1.1' >> /tmp/ezjail.log"
|
||||
shell: "ezjail-admin create testjail 'lo1|127.0.1.1' {{ pkgng_jail_log_redirect }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Configure testjail to use Cloudflare DNS
|
||||
|
|
Loading…
Reference in a new issue