<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pass Morpheus variables into the Chef bootstrap task in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250225#M3399</link>
    <description>&lt;P&gt;Can we pass morpheus variables to the bootstrap task during deployment of an instance?&lt;BR /&gt;
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?&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Let me know if this is possible or if I am missing something.&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 11:36:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2022-05-23T11:36:17Z</dc:date>
    <item>
      <title>Pass Morpheus variables into the Chef bootstrap task</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250225#M3399</link>
      <description>&lt;P&gt;Can we pass morpheus variables to the bootstrap task during deployment of an instance?&lt;BR /&gt;
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?&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Let me know if this is possible or if I am missing something.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 11:36:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250225#M3399</guid>
      <dc:creator />
      <dc:date>2022-05-23T11:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Morpheus variables into the Chef bootstrap task</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250226#M3400</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hpe.com/u/wabbas"&gt;@wabbas&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 15:48:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250226#M3400</guid>
      <dc:creator>KoreyG</dc:creator>
      <dc:date>2022-05-25T15:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Morpheus variables into the Chef bootstrap task</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250227#M3401</link>
      <description>&lt;P&gt;Can you provide some more context as in&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Which workflow phase are you executing the Chef Task?&lt;/LI&gt;
&lt;LI&gt;Where are you executing the task (local/remote/resource)?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Basically you require 2 things assuming you run the task script locally&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set the variable within your script for example environment="&amp;lt;%= instance.environmentPrefix%&amp;gt;" or if you have a custom field use environment="&amp;lt;%= customOptions.customfieldname%&amp;gt;"&lt;/LI&gt;
&lt;LI&gt;Depending on what you want to do with the environment value, you would be able to leverage this something like&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;if [[ $environment = “Production” ]]&lt;BR /&gt;
then&lt;BR /&gt;
do this&lt;/P&gt;
&lt;P&gt;let me know if this helps but depending on your use case it might not be that simple &lt;IMG src="https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20" /&gt;  but happy to share my two cents&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 19:48:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/pass-morpheus-variables-into-the-chef-bootstrap-task/m-p/7250227#M3401</guid>
      <dc:creator />
      <dc:date>2022-05-24T19:48:03Z</dc:date>
    </item>
  </channel>
</rss>

