-
Notifications
You must be signed in to change notification settings - Fork 85
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1d0763b
update zos script sample playbook
ketankelkar 4fcf2ff
fix typo
ketankelkar a2e4373
add description about tags, update description of python script block
ketankelkar eeb1ef8
Merge branch 'main' into z-trial-update-zos-script
ketankelkar c58d326
Merge branch 'main' into z-trial-update-zos-script
ketankelkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* REXX */ | ||
/****************************************************************************** | ||
* © Copyright IBM Corporation 2024 | ||
******************************************************************************/ | ||
|
||
parse arg 'name=' name | ||
|
||
name = strip(name,'L') | ||
say 'Hello ' || name || '.' | ||
|
||
address syscall 'getcwd cwd' | ||
say 'This Rexx script was run inside directory:' cwd | ||
|
||
return 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################### | ||
# © Copyright IBM Corporation 2024 | ||
############################################################################### | ||
|
||
import argparse, os | ||
|
||
# parse 'name' variable as a command line arg. | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--name", help="User's Name.") | ||
args = parser.parse_args() | ||
|
||
# print the value of the parsed arg 'name'. | ||
print("Hello {0}.".format(args.name)) | ||
|
||
# print the current working directory. | ||
print("This python script was run inside directory:", os.getcwd()) |
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
zos_concepts/zos_script/files/templated_loops_and_conditional_sample.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
############################################################################### | ||
# © Copyright IBM Corporation 2024 | ||
############################################################################### | ||
|
||
# Jinja template can access playbook vars and Ansible magic vars . | ||
echo "Hello {{ ansible_user }}." | ||
echo "The playbook was run from directory: {{ playbook_dir }}." | ||
echo "The number is set to: {{ some_num }}". | ||
echo "" | ||
|
||
# Jinja template can implement conditionals. | ||
{% if use_custom_msg %} | ||
msg="{{ custom_msg }}" | ||
{% else %} | ||
msg="Default Hello World" | ||
{% endif %} | ||
|
||
# Jinja template can loop over a range. | ||
{% for i in range(1, 1+some_num) %} | ||
echo "{{ i }} - $msg" | ||
{% endfor %} | ||
|
||
|
||
echo "" | ||
echo "My favorite programming languages in reverse alphabetical order are:" | ||
|
||
# Jinja template can loop over a list. | ||
{% for lang in fav_programming_languages | sort(reverse=True) %} | ||
echo {{ lang }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!!