Answers: <p>You should check the certname of your nginx host, and make sure it matches the name passed to the node block.</p>
  <p>You can find out the certname by running the following command on the nginx host.</p>
  <pre><code>puppet config print certname
  </code></pre>
  <p>From what you describe, the certname does not match: one ends in &quot;.net&quot;, the other ends in &quot;.org&quot;</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-09-01T02:14:38.417Z
Answers: 2022-09-01T06:42:48.960Z
Answers: 2022-09-01T06:42:48.960Z
Answers: K. Shu
Body: <p>I have these definitions for my puppet nodes:</p>
  <p>Nginx node:</p>
  <pre><code>node 'nginx.XXXXXXXX.org' {
    package {&quot;epel-release&quot;:
      ensure =&gt; &quot;installed&quot;,
    }
    package {&quot;nginx&quot;:
      ensure =&gt; &quot;installed&quot;,
    }
    file {lookup(&quot;web_dirs&quot;):
      ensure =&gt; &quot;directory&quot;,
    }
  }
  </code></pre>
  <p>Mongodb node:</p>
  <pre><code>node 'mongodb.XXXXXXXX.org' {
    package { 'mongodb':
      ensure =&gt; 'installed',
    }
    service {'mongodb':
      ensure =&gt; 'running',
      enable =&gt; true,
    }
    file { '/tmp/create_admin.js':
      content =&gt; epp('/etc/puppetlabs/code/environments/production/templates/create_admin.js.epp')
    }
    exec { 'Create the admin user':
      command =&gt; &quot;/usr/bin/mongo &lt; /tmp/create_admin.js &amp;&amp; touch /home/vagrant/db_admin_created&quot;,
      creates  =&gt; &quot;/home/vagrant/db_admin_created&quot;,
    }
    file { '/etc/mongodb.conf':
      source =&gt; &quot;/etc/puppetlabs/code/environments/production/files/mongodb.conf&quot;,
      notify =&gt; Service[&quot;mongodb&quot;],
    }
    file { '/tmp/create_app_user.js':
      content =&gt; epp(&quot;/etc/puppetlabs/code/environments/production/templates/create_app_user.js&quot;)
    }
    exec { &quot;Create the application user&quot;:
      command =&gt; inline_epp(&quot;/usr/bin/mongo -u &lt;%= lookup('db_root_username') %&gt; -p &lt;%= lookup('db_root_password') %&gt; --authenticationDatabase admin &lt; /tmp/create_app_user.js &amp;&amp; touch /home/vagrant/db_user_created&quot;),
      creates =&gt; &quot;/home/vagrant/db_user_created&quot;,
    }
    exec { &quot;Removes the JS script files&quot;:
      command =&gt; &quot;/bin/rm -rf /tmp/create_admin.js /tmp/create_app_user.js&quot;,
    }
  }
  
  node default {
    notify { 'This node did not match any of the listed definitions':}
  }
  </code></pre>
  <p>Node node:</p>
  <pre><code>node 'node.XXXXXXXX.org' {
    package {&quot;epel-release&quot;:
      ensure =&gt; &quot;installed&quot;,
    }
    package {&quot;nodejs&quot;:
      ensure =&gt; &quot;installed&quot;,
    }
    package {&quot;npm&quot;:
      ensure =&gt; &quot;installed&quot;,
    }
    file { lookup('app_dir'):
      ensure   =&gt; &quot;directory&quot;,
      source   =&gt; &quot;/etc/puppetlabs/code/environments/production/files/appfiles/&quot;,
      recurse =&gt; true
    }
    exec { &quot;Run npm against package.json&quot;:
      command =&gt; &quot;/usr/bin/npm install&quot;,
      cwd     =&gt; lookup(&quot;app_dir&quot;),
    }
    file {&quot;${lookup('app_dir')}/server.js&quot;:
      content =&gt; epp(&quot;/etc/puppetlabs/code/environments/production/templates/server.js.epp&quot;),
      mode    =&gt; &quot;0755&quot;
    }
    file {&quot;/etc/systemd/system/node.service&quot;:
      content =&gt; epp(&quot;/etc/puppetlabs/code/environments/production/templates/node.service.epp&quot;),
    }
    service {&quot;node&quot;:
      ensure =&gt; &quot;running&quot;,
      enable =&gt; true,
    }
  }
  </code></pre>
  <p>I have setup a workflow where the master puppet node called puppet host's a git repo from which these three pull manifest configs and apply them locally. Out of all the three nodes the Nginx node produces the following error when I apply a manifest change:</p>
  <pre><code>Notice: Compiled catalog for nginx.mshome.net in environment production in 0.03 seconds
  Notice: This node did not match any of the listed definitions
  Notice: /Stage[main]/Main/Node[default]/Notify[This node did not match any of the listed definitions]/message: defined 'message' as 'This node did not match any of the listed definitions'
  Notice: Applied catalog in 0.02 seconds
  </code></pre>
  <p>I have looked at my definitions and I can't seem to find what is off about the nginx node, any pointers would be appreciated. Also note these machines were created using vagrant.</p>
  
Tags: <puppet>
Title: Puppet Notice: This node did not match any of the listed definitions
UserDisplayName: George Udosen
ThreadText: # Puppet Notice: This node did not match any of the listed definitions
  
  (Asked by: username_0 on 2022-04-12)
  
  I have these definitions for my puppet nodes:
  
  Nginx node:
  
  ```
  node 'nginx.XXXXXXXX.org' {
    package {"epel-release":
      ensure => "installed",
    }
    package {"nginx":
      ensure => "installed",
    }
    file {lookup("web_dirs"):
      ensure => "directory",
    }
  }
  
  ```
  
  Mongodb node:
  
  ```
  node 'mongodb.XXXXXXXX.org' {
    package { 'mongodb':
      ensure => 'installed',
    }
    service {'mongodb':
      ensure => 'running',
      enable => true,
    }
    file { '/tmp/create_admin.js':
      content => epp('/etc/puppetlabs/code/environments/production/templates/create_admin.js.epp')
    }
    exec { 'Create the admin user':
      command => "/usr/bin/mongo < /tmp/create_admin.js && touch /home/vagrant/db_admin_created",
      creates  => "/home/vagrant/db_admin_created",
    }
    file { '/etc/mongodb.conf':
      source => "/etc/puppetlabs/code/environments/production/files/mongodb.conf",
      notify => Service["mongodb"],
    }
    file { '/tmp/create_app_user.js':
      content => epp("/etc/puppetlabs/code/environments/production/templates/create_app_user.js")
    }
    exec { "Create the application user":
      command => inline_epp("/usr/bin/mongo -u <%= lookup('db_root_username') %> -p <%= lookup('db_root_password') %> --authenticationDatabase admin < /tmp/create_app_user.js && touch /home/vagrant/db_user_created"),
      creates => "/home/vagrant/db_user_created",
    }
    exec { "Removes the JS script files":
      command => "/bin/rm -rf /tmp/create_admin.js /tmp/create_app_user.js",
    }
  }
  
  node default {
    notify { 'This node did not match any of the listed definitions':}
  }
  
  ```
  
  Node node:
  
  ```
  node 'node.XXXXXXXX.org' {
    package {"epel-release":
      ensure => "installed",
    }
    package {"nodejs":
      ensure => "installed",
    }
    package {"npm":
      ensure => "installed",
    }
    file { lookup('app_dir'):
      ensure   => "directory",
      source   => "/etc/puppetlabs/code/environments/production/files/appfiles/",
      recurse => true
    }
    exec { "Run npm against package.json":
      command => "/usr/bin/npm install",
      cwd     => lookup("app_dir"),
    }
    file {"${lookup('app_dir')}/server.js":
      content => epp("/etc/puppetlabs/code/environments/production/templates/server.js.epp"),
      mode    => "0755"
    }
    file {"/etc/systemd/system/node.service":
      content => epp("/etc/puppetlabs/code/environments/production/templates/node.service.epp"),
    }
    service {"node":
      ensure => "running",
      enable => true,
    }
  }
  
  ```
  
  I have setup a workflow where the master puppet node called puppet host's a git repo from which these three pull manifest configs and apply them locally. Out of all the three nodes the Nginx node produces the following error when I apply a manifest change:
  
  ```
  Notice: Compiled catalog for nginx.mshome.net in environment production in 0.03 seconds
  Notice: This node did not match any of the listed definitions
  Notice: /Stage[main]/Main/Node[default]/Notify[This node did not match any of the listed definitions]/message: defined 'message' as 'This node did not match any of the listed definitions'
  Notice: Applied catalog in 0.02 seconds
  
  ```
  
  I have looked at my definitions and I can't seem to find what is off about the nginx node, any pointers would be appreciated. Also note these machines were created using vagrant.
  
  **Tags:** puppet
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-09-01. Score: 0
  
  You should check the certname of your nginx host, and make sure it matches the name passed to the node block.
  
  You can find out the certname by running the following command on the nginx host.
  
  ```
  puppet config print certname
  
  ```
  
  From what you describe, the certname does not match: one ends in ".net", the other ends in ".org"
  
  
  ---
  
  