Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update zos script sample playbook #278

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Conversation

ketankelkar
Copy link
Member

The previous version of this sample playbook was well done. It showed off 3 significant "features" of the zos_script module via 3 separate tasks - command line args, module options chdir/executable, and jinja-templated scripts.

I've kept a similar structure as above and have introduced blocks to separate the 3 groups. The first itemis a hello-world Rexx script which parses a command line arg name and prints out "Hello name" and the current working directory. The second item is a hello-world python script which does much the same as the Rexx script, reading a command line arg, printing out a "hello " message and printing out the 'current working directory'; but this item also requires the executable to be set and also showcases the chdir option. The user is invited to compare the 'current working directories' printed by the first two items.

The third item is a jinja-templated shell script. Three types of templating features are showcased in this script. First is a simple string substitution, i.e echo "Hello {{ ansible_user }}". The next is a conditional statement, and finally two types of loops -- over a range and through a list.

I trust that the descriptions included in the playbook tasks and comments are well-written and offer clarity, please do point out any areas which could use any amount of improvement

Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
Copy link
Member

@richp405 richp405 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen the zport issue before... I believe it relates to a troublesome import.

Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
Copy link
Contributor

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left a couple of suggestions, nothing major. Once questions are answered I will approve

@@ -11,18 +11,22 @@
#
# Example:
# ansible-playbook -i inventories zos_script.yml
# ansible-playbook -i inventories zos_script.yml --tags rexx_script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about the tags, it is a nice of overloading the playbook but probably a new user won't know them either, maybe you can add a small hint that if user wants to just execute rexx script section he can use this command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!!

# The task also passes in a command line arg like the previous one did.
# The 'executable' module option enables running other types of scripts by
# passing in a path to the appropriate executable. The Ansible inventory
# variable 'ansible_python_interpreter' is typically used to specify the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it always true instead of tipically?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, good point. I'll change it

My initial thinking was that the "typical" use was to tell ansible-core where remote python is, but since it's used in this playbook task to tell zos_script where remote python is, that would be an a-typical' use.

Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
@ketankelkar ketankelkar added the Branch: Do not Merge When a pull request should not be merged for issue noted reasons label Sep 10, 2024
@ketankelkar ketankelkar removed the Branch: Do not Merge When a pull request should not be merged for issue noted reasons label Sep 16, 2024
@ketankelkar ketankelkar self-assigned this Sep 24, 2024
@ketankelkar ketankelkar merged commit 04e6158 into main Sep 27, 2024
3 checks passed
@ketankelkar ketankelkar deleted the z-trial-update-zos-script branch September 27, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enabler][Z Trial] (8) Scenario 5 - Update script playbook to the sample playbook repository
3 participants