Currently, a majority of the Linux RightScripts in the MultiCloud Marketplace use Bash and Ruby. However, you can use almost any scripting language as long as the interpreter is installed and you define the inputs 'like variables' in comments at the beginning of your script. Defining your script this way gives you the benefits of our version control, change auditing, and the ability to attach files to accompany the script.
1. Create a New RightScript. Write a script in your preferred language (Python is used in the example below), defining one input via a comment. Then, use the language-specific method to retrieve regular environment variables:
#!/usr/bin/python # # Inputs: # $TEST_PARAM import os # Print the input to the audit entries print os.environ['TEST_PARAM']
2. Use the "Identify" button to identify the inputs defined in the script comments. Save the script.
3. You are now ready to run the RightScript and observe its results under the Audit Entries tab. ("Hello Python World" was used as the TEST_PARAM in the example below.)
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.