Мой результат задачи:
Код: Выделить всё
ok: [Host1] => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"show file systems | inc flash:"
],
"interval": 1,
"match": "all",
"retries": 10,
"wait_for": null
}
},
"stdout": [
"* 1707192 (1.6 GB) 603744 (589.6 MB) flash rw flash:"
],
"stdout_lines": [
[
"* 1707192 (1.6 GB) 603744 (589.6 MB) flash rw flash:"
]
]
}
Код: Выделить всё
- set_fact:
my_var: "{{ disk_space.stdout_lines | regex_findall('\\b([0-9]{1,4}\\.\\d+)\\s+MB.*flash:$') }}"
Код: Выделить всё
ok: [Host1] => {
"ansible_facts": {
"my_var": []
},
"changed": false
}
С уважением,
Правин
Подробнее здесь: https://stackoverflow.com/questions/787 ... e-playbook