Change just a part of a line - zos_lineinfile #902
-
Hello everybody! "//OUTPUT DD DSN=LBS.CICP01.V560.SDFHAUTH I know I can change the regex to find just the value I want, but even then the entire line must be "rewritten". In some cases this can generate errors, delete other parameters, etc. It would be interesting if I could just find V560, for example, and change it to V610, in case of versioning a product. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @fabiobncbb , we don't have a module yet that can perform word replacement, while such a module is in our internal backlog (zos_replace) , the module design is not yet complete there for not in our public backlog, but the good news is that since Ansible is so flexible there are other ways to achieve this. My recommendation is to use ZOAU dsed directly. Only note that there is a but we are looking into so you can't perform something like:
But you can do this instead:
Playbook recreate (i know you mentioned PDSE, but leave that exercise up to you, I used a sequential, should be same):
Output:
I believe this should answer your question and be able to mark this resolved and close. Watch our issues for a zos_replace module, it is not in plan, will be like be an early 2024 item. |
Beta Was this translation helpful? Give feedback.
Hi @fabiobncbb , we don't have a module yet that can perform word replacement, while such a module is in our internal backlog (zos_replace) , the module design is not yet complete there for not in our public backlog, but the good news is that since Ansible is so flexible there are other ways to achieve this.
My recommendation is to use ZOAU dsed directly. Only note that there is a but we are looking into so you can't perform something like:
But you can do this instead:
Playbook recreate (i know you mentioned PDSE, but leave that exercise up to you, I used a sequential, should be same):