mirror of https://github.com/ansible/ansible.git
Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>pull/83825/head
parent
520fa688ba
commit
90de03be50
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- setup module (fact gathering), added fallbcak code path to handle mount fact gathering in linux when threading is not available
|
||||||
@ -0,0 +1 @@
|
|||||||
|
from __future__ import annotations
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
||||||
|
class ThreadPool:
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
raise PermissionError("To test single proc ansible")
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- set_fact:
|
||||||
|
normal_devices: "{{ ansible_facts['devices'].keys() }}"
|
||||||
|
|
||||||
|
- name: facts already gathered normally, but now we do mounts again w/o multithreading
|
||||||
|
gather_facts:
|
||||||
|
gather_subset: mounts
|
||||||
|
register: no_multi
|
||||||
|
environment:
|
||||||
|
PYTHONPATH: "${PWD}/lib"
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
single_devices: "{{no_multi['ansible_facts']['ansible_devices'].keys()}}"
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- normal_devices == single_devices
|
||||||
|
when:
|
||||||
|
- ansible_facts['os_family'] not in ['FreeBSD', 'Darwin']
|
||||||
Loading…
Reference in New Issue