Ask Your Question
0

Catalog On Agent Missing Requires From Manifest

asked 2018-02-07 13:17:07 -0600

Liz gravatar image

Using puppet 3.8.5 on agent and puppet 3.8.7 on puppet master.

I have a mailhog.pp manifest that's been working great with our php5 systems. I added a php7.0 system with mailhog so I added some conditions to check for Ubuntu version and use php7.0 instead of php5 if version was greater than 16. I keep getting this error on the agent when I run sudo puppet agent --test --onetime --server puppet.mydomain.ca --debug:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Ini_setting[php-cli-mailhog] { require => Package[php7.0-cli] }, because Package[php7.0-cli] doesn't seem to be in the catalog

When I cat the catalog.json in /var/lib/puppet/client_data/catalog/ anything regarding php7.0 is missing. The catalog does update, just doesn't include what's in the manifest. I'm missing something and not sure what.

My /etc/puppet/environments/active/modules/web/manifests/mailhog.pp condition for the new php7.0 requirement:

if $enforce_cli {
  if $::operatingsystemrelease > 16 {
    ini_setting { 'php-cli-mailhog':
      path => '/etc/php/7.0/cli/php.ini',
      section => 'mail function',
      setting => 'sendmail_path',
      value => '/usr/local/bin/mhsendmail internal-dummy@mydomain.ca',
      require => [
        Package['php7.0-cli'],
        Remote_file['mhsendmail'],
        Service['mailhog'],
      ],
    }
  }
  else {
    ini_setting { 'php-cli-mailhog':
      path => '/etc/php5/cli/php.ini',
      section => 'mail function',
      setting => 'sendmail_path',
      value => '/usr/local/bin/mhsendmail internal-dummy@mydomain.ca',
      require => [
        Package['php5-cli'],
        Remote_file['mhsendmail'],
        Service['mailhog'],
      ],
    }
  }
}

My /etc/puppet/environments/active/modules/web/manifests/init.pp condition for the new php7.0 requirement:

if $::operatingsystemrelease in ['12.04', '12.10', '13.04', '13.10', '14.04', '14.10'] {
  $phpkg = 'php5'
  $use_mysqlnd = true
}
elsif $::operatingsystemrelease > 16 {
  $phpkg = 'php7.0'
  # Does not have a php-mysqlnd package
  $use_mysqlnd = false
}
package{ [
  "${phpkg}-mcrypt",
  "${phpkg}-gd",
  "${phpkg}-memcache",
  "${phpkg}-ldap",
  "${phpkg}-curl",
  "${phpkg}-cli",
  "libapache2-mod-${phpkg}"
  ]:
  ensure => present,
}

Totally stumped at this point. Any help would be awesome. Let me know if anyone needs more info. Thanks!

edit retag flag offensive close merge delete

Comments

This was an oversight on my part: the `web::mailhog` class was added but the host class (`/etc/puppet/environments/active/modules/web` which shows as `host-type-web` in foreman front end) `web` was not attached, so puppet got confused.

Liz gravatar imageLiz ( 2018-02-09 14:21:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-02-12 03:04:53 -0600

Henrik Lindberg gravatar image

Adding an answer so others does not have to try to answer this.

Reason resources where reported as missing was that they actually were missing (according to Liz).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-07 12:00:20 -0600

Seen: 77 times

Last updated: Feb 12