- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise Software
- >
- Pass Morpheus variables into the Chef bootstrap ta...
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 04:36 AM
05-23-2022 04:36 AM
Pass Morpheus variables into the Chef bootstrap task
Can we pass morpheus variables to the bootstrap task during deployment of an instance?
I am attempting to pass variables into the chef bootstrap task, and having some issues with the task recognizing that it is a variable. Is this supported?
Example: I have a policy for mandatory environment selection. If I have this as a mandatory item, I want to pass that variable as the environment with a chef bootstrap task. Currently, it is not recognizing it as a variable and attempting to load the variable name itself as the environment and fails.
Let me know if this is possible or if I am missing something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2022 08:48 AM
05-25-2022 08:48 AM
Re: Pass Morpheus variables into the Chef bootstrap task
Hi @wabbas,
Looking over the Chef Bootstrap task, the environment field in the bootstrap task is not interpreting the variables, as you mentioned. I’d recommend submitting a support case for it as a bug. I did find the “Node Attributes” field does interpret the variables as expected.
Alternatively, you could opt to creating a shell script task (or other language) that would bootstrap the node and set the variable types as you’d want. Another short term idea, you could make a few tasks with the value in it, assign them to different workflows, and choose the appropriate workflow as needed.
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 12:48 PM
05-24-2022 12:48 PM
Re: Pass Morpheus variables into the Chef bootstrap task
Can you provide some more context as in
- Which workflow phase are you executing the Chef Task?
- Where are you executing the task (local/remote/resource)?
Basically you require 2 things assuming you run the task script locally
- Set the variable within your script for example environment="<%= instance.environmentPrefix%>" or if you have a custom field use environment="<%= customOptions.customfieldname%>"
- Depending on what you want to do with the environment value, you would be able to leverage this something like
if [[ $environment = “Production” ]]
then
do this
let me know if this helps but depending on your use case it might not be that simple
but happy to share my two cents