简体   繁体   中英

"puppet agent --test" on client machine aren't getting manifest from the Puppet master server

Issue

So I have two AWS instances: a Puppet master and a Puppet client. When I run sudo puppet agent --test on my client, the tasks defined in my master's manifest didn't apply to the client instance.

Where I am right now

  • puppetmaster is installed on the master instance
  • puppet is installed on client instance
  • Master just finished signing my client's certificate. No errors were displayed
  • Master has a /etc/puppet/manifests/site.pp
  • Client's puppet.conf file has a server=dns_of_master line
  • My Puppet version is 5.4.0. I'm using the default manifest configuration.
  • Here's the guide that I'm following: https://www.digitalocean.com/community/tutorials/getting-started-with-puppet-code-manifests-and-modules . The only changes are the site.pp content and that I'm using AWS.
  • If it helps, here's my AWS instances' AMI: ami-06d51e91cea0dac8d

Details

Here's the content on my master's /etc/puppet/manifests/site.pp :

node default {
        package { 'nginx':
        ensure => installed
        }
        service { 'nginx':
        ensure => running,
        require => Package['nginx']
        }
        file { '/tmp/hello_world':
        ensure => present,
        content => 'Hello, World!'
        }
}

The file has a permission of 777.

Here's the ouput when I run sudo puppet agent --test . This is after I ran sudo puppet agent --enable :

Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Caching catalog for my_client_dns
Info: Applying configuration version '1578968015'
Notice: Applied catalog in 0.02 seconds

I have looked at other StackOverflow posts with this issue. I know that my catalog is not getting applied due to the lack of status messages and the quick time. Unfortunately, the solutions didn't apply to my case:

  • My site.pp is named correctly and in the correct file path /etc/puppet/manifests
  • I didn't touch my master's puppet.conf file
  • I tried restarting the server with sudo systemctl but nothing happens

So I have fixed the issue. The guide that I was following required an older version of Ubuntu (16.4, rather than 18.4 as I'm using). This needs a different AMI than the one that I used to create the instances.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM