<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 6:32 AM, Roquesalane, Jean-Pierre <span dir="ltr"><<a href="mailto:Jeanpierre.Roquesalane@dell.com" target="_blank">Jeanpierre.Roquesalane@dell.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div>
<p class="MsoNormal">Dear fellow stackers,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’m currently trying to run a manifest from within a heat template. This manifest test the hostname and depending on the value will do different things. I need to pass some extra variables that are set in an environment file to the manifest,
and It failed so far. I’m driving nuts at this moment and even though all of the things I found on google, there is no way to get it work.
</p>
<p class="MsoNormal">RHOSP 10 is driving my overcloud.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Any help would be much appreciated.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Below are the files I’m using.</p>
<p class="MsoNormal"> </p>
<p class="gmail-m_2897163334249099074MsoListParagraph"><span style="font-family:Symbol"><span>·<span style="font:7pt "Times New Roman"">
</span></span></span>Heat Template</p>
<div style="border-width:1pt;border-style:solid;border-color:windowtext;padding:1pt 4pt">
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">heat_template_version: 2016-10-14</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">description: ></p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> NFV Feature Hugepages configured by Puppet for computeNfv role.</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">parameters:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> servers:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> type: json</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageSize:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> type: string</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageCount:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> type: string</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">resources:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> NovaComputeExtraConfig:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> type: OS::Heat::SoftwareConfig</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> properties:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> group: puppet</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> inputs:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> - name: HugePageSize</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> - name: HugePageCount</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> config:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> get_file: ../manifests/hugepages.pp</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> options:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> enable_hiera: True</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> enable_facter: False</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> </p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> ExtraPuppetDeployment:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> type: OS::Heat::SoftwareDeployments</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> properties:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> servers: {get_param: servers}</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> config: {get_resource: NovaComputeExtraConfig}</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> input_values:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageSize: {get_param: HugePageSize}</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageCount: {get_param: HugePageCount}</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> actions: ['CREATE','UPDATE']</p>
</div>
<p class="MsoNormal" style="margin-left:18pt"> </p>
<p class="gmail-m_2897163334249099074MsoListParagraph"><span style="font-family:Symbol"><span>·<span style="font:7pt "Times New Roman"">
</span></span></span>Puppet manifest</p>
<div style="border-width:1pt;border-style:solid;border-color:windowtext;padding:1pt 4pt">
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">if $hostname =~ /compute-nfv/ {</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> file { '/tmp/test_puppet':</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> ensure => 'file',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> content => "This is an NFV node!!! Setting ${HugePageCount} pages of ${HugePageSize} each",</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> owner => 'root',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> group => 'root',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> mode => 0777,</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> }</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">} else {</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> file { '/tmp/test_puppet':</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> ensure => 'file',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> content => 'This is not an NFV node... Nothing to set',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> owner => 'root',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> group => 'root',</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> mode => 0777,</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> }</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">}</p>
</div>
<p class="MsoNormal" style="margin-left:18pt"> </p>
<p class="gmail-m_2897163334249099074MsoListParagraph"><span style="font-family:Symbol"><span>·<span style="font:7pt "Times New Roman"">
</span></span></span>Environment file</p>
<div style="border-width:1pt;border-style:solid;border-color:windowtext;padding:1pt 4pt">
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">resource_registry:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> OS::TripleO::<wbr>NodeExtraConfigPost: puppet/services/hugepages.yaml</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%">parameter_defaults:</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> OvercloudComputeNfvFlavor: baremetal</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> ComputeNfvCount: 3</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageSize: 2048</p>
<p class="MsoNormal" style="margin-left:18pt;background:rgb(247,202,172) none repeat scroll 0% 0%"> HugePageCount: 4</p>
</div>
<p class="MsoNormal"> </p></div></div></blockquote><div><br></div><div style="font-family:monospace,monospace" class="gmail_default">Since you're setting use_hiera:True in the config, there should be a hieradata file created for the config under /etc/puppet/hieradata on the node(s) associated with the deployment.</div><div style="font-family:monospace,monospace" class="gmail_default"><br></div><div style="font-family:monospace,monospace" class="gmail_default">That hiera file should automatically be included whenever you run puppet due to the <span class="gmail-pl-s">FACTER_deploy_config_name fact, and the templated use of deploy_config_name in the hierarchy configured in /etc/puppet/hiera.yaml.<br></span></div><div style="font-family:monospace,monospace" class="gmail_default"><span class="gmail-pl-s"><br></span></div><div style="font-family:monospace,monospace" class="gmail_default"><span class="gmail-pl-s">I'd start by checking all that to see if it got configured correctly. You should be able to see the full puppet command run by the agent in the os-collect-config log output on each node, and that may help you troubleshoot as you can copy/paste the command and rerun it.</span></div><div style="font-family:monospace,monospace" class="gmail_default"><span class="gmail-pl-s"><br></span></div><div style="font-family:monospace,monospace" class="gmail_default"><span class="gmail-pl-s">Also, you may just try setting use_facter:True in the config and see if that fixes it as well.<br></span></div></div><br>-- <br><div class="gmail_signature">-- James Slagle<br>--</div>
</div></div>