I have a task
- name: DELEGATED ADMIN ACCOUNTS - check, get and send to the file domain.list
shell: /opt/zimbra/bin/zmprov -l gaaa -v zimbraIsDelegatedAdminAccount
and after this task I got output
changed: [Shrrah] => {
"changed": true,
"cmd": [
"sh",
"/home/information_domain.sh"
],
"delta": "0:00:02.495922",
"end": "2022-03-29 10:25:16.936051",
"invocation": {
"module_args": {
"_raw_params": "sh /home/information_domain.sh",
"_uses_shell": false,
"argv": null,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"stdin_add_newline": true,
"strip_empty_ends": true,
"warn": false
}
},
"msg": "",
"rc": 0,
"start": "2022-03-29 10:25:14.440129",
"stderr": "",
"stderr_lines": [],
"stdout": "# name [email protected]\nzimbraIsDelegatedAdminAccount: FALSE\n\n# name [email protected]\n\n# name [email protected]\nzimbraIsDelegatedAdminAccount: TRUE\n\n# name [email protected]",
"stdout_lines": [
"# name [email protected]",
"zimbraIsDelegatedAdminAccount: FALSE",
"",
"# name [email protected]",
"",
"# name [email protected]",
"zimbraIsDelegatedAdminAccount: TRUE",
"",
"# name [email protected]"
]
}
I need to get data with n# name [email protected]\nzimbraIsDelegatedAdminAccount: TRUE
from "stdout"
or from "stdout_lines"
in format:
[email protected] zimbraIsDelegatedAdminAccount: TRUE
or
[email protected]
zimbraIsDelegatedAdminAccount: TRUE
and send it to the file.txt
. Number of lines can be different (one o more users with domain).
I have no idea how I can do this, is this possible? If you know could you please help with advice? Thank you!