|
- ---
- - name: Create lv
- hosts: all
- tasks:
- - name: Check vg
- shell: vgdisplay research
- register: v_result
- ignore_errors: yes
- - name: Display
- debug:
- var: v_result
复制代码 TASK [Display] *****************************************************************
ok: [servera] => {
"v_result": {
"changed": true,
"cmd": "vgdisplay research",
"delta": "0:00:00.129534",
"end": "2020-12-05 14:55:53.499846",
"failed": false,
"rc": 0,
"start": "2020-12-05 14:55:53.370312",
"stderr": "",
"stderr_lines": [],
"stdout": " --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID yQkRif-wJpB-DfYb-OoT7-wIZ5-m074-yE7vtk\n ",
"stdout_lines": [
" --- Volume group ---",
" VG Name research",
" System ID ",
" Format lvm2",
" Metadata Areas 1",
" Metadata Sequence No 2",
" VG Access read/write",
" VG Status resizable",
" MAX LV 0",
" Cur LV 1",
" Open LV 0",
" Max PV 0",
" Cur PV 1",
" Act PV 1",
" VG Size <2.20 GiB",
" PE Size 4.00 MiB",
" Total PE 562",
" Alloc PE / Size 512 / 2.00 GiB",
" Free PE / Size 50 / 200.00 MiB",
" VG UUID yQkRif-wJpB-DfYb-OoT7-wIZ5-m074-yE7vtk",
" "
]
}
}
ok: [serverb] => {
"v_result": {
"changed": true,
"cmd": "vgdisplay research",
"delta": "0:00:00.132031",
"end": "2020-12-05 14:55:53.798468",
"failed": false,
"rc": 0,
"start": "2020-12-05 14:55:53.666437",
"stderr": "",
"stderr_lines": [],
"stdout": " --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID JKwLgC-wWc0-Yh6o-y6wl-z27b-pcDV-eEprUs\n ",
"stdout_lines": [
" --- Volume group ---",
" VG Name research",
" System ID ",
" Format lvm2",
" Metadata Areas 1",
" Metadata Sequence No 2",
" VG Access read/write",
" VG Status resizable",
" MAX LV 0",
" Cur LV 1",
" Open LV 0",
" Max PV 0",
" Cur PV 1",
" Act PV 1",
" VG Size <2.20 GiB",
" PE Size 4.00 MiB",
" Total PE 562",
" Alloc PE / Size 512 / 2.00 GiB",
" Free PE / Size 50 / 200.00 MiB",
" VG UUID JKwLgC-wWc0-Yh6o-y6wl-z27b-pcDV-eEprUs",
" "
]
}
}
ok: [serverc] => {
"v_result": {
"changed": true,
"cmd": "vgdisplay research",
"delta": "0:00:00.092255",
"end": "2020-12-05 14:55:53.826695",
"failed": true,
"msg": "non-zero return code",
"rc": 5,
"start": "2020-12-05 14:55:53.734440",
"stderr": " Volume group \"research\" not found\n Cannot process volume group research",
"stderr_lines": [
" Volume group \"research\" not found",
" Cannot process volume group research"
],
"stdout": "",
"stdout_lines": []
}
}
ok: [serverd] => {
"v_result": {
"changed": true,
"cmd": "vgdisplay research",
"delta": "0:00:00.119632",
"end": "2020-12-05 14:55:53.742737",
"failed": true,
"msg": "non-zero return code",
"rc": 5,
"start": "2020-12-05 14:55:53.623105",
"stderr": " Volume group \"research\" not found\n Cannot process volume group research",
"stderr_lines": [
" Volume group \"research\" not found",
" Cannot process volume group research"
],
"stdout": "",
"stdout_lines": []
}
}
- ---
- - name: Create lv
- hosts: all
- tasks:
- - name: Check vg
- shell: vgdisplay research
- register: v_result
- ignore_errors: yes
- - name: Display
- debug:
- msg: >
- "{{ v_result.stdout }}" is OK.
- XXXXX is OK.
复制代码 TASK [Display] **********************************************************************************************
ok: [servera] => {
"msg": "\" --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID yQkRif-wJpB-DfYb-OoT7-wIZ5-m074-yE7vtk\n \" is OK. XXXXX is OK.\n"
}
ok: [serverb] => {
"msg": "\" --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID JKwLgC-wWc0-Yh6o-y6wl-z27b-pcDV-eEprUs\n \" is OK. XXXXX is OK.\n"
}
ok: [serverc] => {
"msg": "\"\" is OK. XXXXX is OK.\n"
}
ok: [serverd] => {
"msg": "\"\" is OK. XXXXX is OK.\n"
}
---
- name: Create lv
hosts: all
tasks:
- name: Check vg
shell: vgdisplay research
register: v_result
ignore_errors: yes
- name: Display
debug:
msg: |
"{{ v_result.stdout }}" is OK.
XXXXX is OK.
- ---
- - name: Create lv
- hosts: all
- tasks:
- - name: Check vg
- shell: vgdisplay research
- register: v_result
- ignore_errors: yes
- - name: Display
- debug:
- msg: |
- "{{ v_result.stdout }}" is OK.
- XXXXX is OK.
复制代码 ok: [servera] => {
"msg": "\" --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID yQkRif-wJpB-DfYb-OoT7-wIZ5-m074-yE7vtk\n \" is OK.\nXXXXX is OK.\n"
}
ok: [serverb] => {
"msg": "\" --- Volume group ---\n VG Name research\n System ID \n Format lvm2\n Metadata Areas 1\n Metadata Sequence No 2\n VG Access read/write\n VG Status resizable\n MAX LV 0\n Cur LV 1\n Open LV 0\n Max PV 0\n Cur PV 1\n Act PV 1\n VG Size <2.20 GiB\n PE Size 4.00 MiB\n Total PE 562\n Alloc PE / Size 512 / 2.00 GiB\n Free PE / Size 50 / 200.00 MiB\n VG UUID JKwLgC-wWc0-Yh6o-y6wl-z27b-pcDV-eEprUs\n \" is OK.\nXXXXX is OK.\n"
}
ok: [serverc] => {
"msg": "\"\" is OK.\nXXXXX is OK.\n"
}
ok: [serverd] => {
"msg": "\"\" is OK.\nXXXXX is OK.\n"
}
|
|