-
Notifications
You must be signed in to change notification settings - Fork 83
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
Conversation
Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
There was a problem hiding this 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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
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 optionschdir
/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 "Helloname
" 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 theexecutable
to be set and also showcases thechdir
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