Puppet classes not showing up in Foreman

Hello fellow Foremen,

I am digging more and more into Puppet and am reaching out to control that
with Foreman.

I am developing my puppet classes using a vagrant vm and puppet apply. Now
I am moving the working classes to foreman and most of them don't show up
in foreman classes lists. I imported from the master and the modules from
forge show up with no problem, but most of y own do not. They work as
expected when included in a node definition in site.pp

Are there any guidelines how a puppet class has to look like to work in
foreman?

For example, using puppetlabs-apache and other classes, I want to set up my
webserver like this:

from modules/my-apache/manifests/init.pp:

class my-apache {
package { "cronolog":
ensure => "installed"
}

class { 'apache':
default_mods => false,
default_confd_files => false,
mpm_module => 'prefork';
}

include apache::mod::rewrite
include apache::mod::auth_basic
include apache::mod::authn_file
include apache::mod::authz_default
include apache::mod::authz_user

class { 'php': }
php::module { "imagick": }
php::module { "gd": }
php::module { 'xdebug':}

php::augeas { 'php-memorylimit':
entry => 'PHP/memory_limit',
value => '128M';
'php-date_timezone':
entry => 'Date/date.timezone',
value => 'Europe/Berlin';
'php-error_reporting':
entry => 'PHP/error_reporting',
value => 'E_ALL & ~E_NOTICE';
'php-display_errors':
entry => 'PHP/display_errors',
value => 'off';
'php-session_cache-limiter':
entry => 'Session/session.cache_limiter',
value => 'nocache';
'php-session_autostart':
entry => 'Session/session.auto_start',
value => '0';
'php-expose_php':
entry => 'PHP/expose_php',
value => 'off';
'php-allow_url_fopen':
entry => 'PHP/allow_url_fopen',
value => 'off';
}

··· # # V E R Z E I C H N I S S E # file {['/srv', '/srv/www']: ensure => directory, owner => 'root', group => 'root', mode => '0644', }

file {[’/etc/ssl’, ‘/etc/ssl/certs’, ‘/etc/ssl/intermediate’,
’/etc/ssl/private’]:
ensure => directory,
owner => ‘root’,
group => ‘root’,
mode => ‘0644’,
}


}

Thanks in advance

Jochen

Hi again,

mhmm… there are other classes not showing up as well,for example
leinaddm/htpasswdfrom the forge is working just fine for me but does not
show up in foreman after an import.

I asked google, but I cannot find a documentation on what a class must
provide to show up in foreman

I have a related question, the PowerShell module does not show up either,
in appears!

One Foreman server…

[root@foreman modules]# puppet module list --modulepath
/etc/puppet/environments/production/modules
/etc/puppet/environments/production/modules
├── puppetlabs-ntp (v3.3.0)
├── puppetlabs-powershell (v1.0.4)
└── puppetlabs-stdlib (v4.5.0)
[root@foreman modules]#

Put in Foreman UI under Puppet Classes, I only see 'ntp' and 'stdlib' never
powershell. So the question is, does Foreman Puppet class support not
include Windows?

I need Foreman to execute PowerShell script on Windows server provisioned
by Foreman. I loaded the PowerShell module in Windows server after Puppet
agent installed, tested, and validated. And local test (on Windows server
in question) worked, PowerShell provider and powershell script executed as
expected. But I can't get Foreman to import the Puppet class so I can't
add the Puppet class/module to the given host, i.e. Windows server.

If the class can't be parsed, it won't show up. Run puppet parser validate on the manifests of the module and see if any errors are returned.

Hi,

I found some problems with puppet module's unicode characters and foreman (
1.10 )
http://projects.theforeman.org/issues/13219

br, Arto

keskiviikko 31. joulukuuta 2014 8.08.21 UTC+2 Schorschi Decker kirjoitti:

··· > > I have a related question, the PowerShell module does not show up either, > in appears! > > One Foreman server... > > [root@foreman modules]# puppet module list --modulepath > /etc/puppet/environments/production/modules > /etc/puppet/environments/production/modules > ├── puppetlabs-ntp (v3.3.0) > ├── puppetlabs-powershell (v1.0.4) > └── puppetlabs-stdlib (v4.5.0) > [root@foreman modules]# > > Put in Foreman UI under Puppet Classes, I only see 'ntp' and 'stdlib' > never powershell. So the question is, does Foreman Puppet class support > not include Windows? > > I need Foreman to execute PowerShell script on Windows server provisioned > by Foreman. I loaded the PowerShell module in Windows server after Puppet > agent installed, tested, and validated. And local test (on Windows server > in question) worked, PowerShell provider and powershell script executed as > expected. But I can't get Foreman to import the Puppet class so I can't > add the Puppet class/module to the given host, i.e. Windows server. >

Also, make sure that the module path is correct. Perhaps /etc/puppet/modules or other location is not in your puppet.conf.

Hi Garett,

the module validetes just fine and it was run with puppet apply locally
from a node definition before. I don't think it's a location problem as
other modules from the same modules folder are imported. When importing,
Foreman detects the environments just fine and imports from there. I did
nothing to puppet.conf in that respect…

I have environmentpath = /etc/puppet/environments under [master]
There was a folder production with manifests and modules. I place my
modules there.

I added a folder development to set up a second environment. Foreman is
importing from there just fine as well, but the same modules are missing as
in production.

Regards
Jochen

··· Am Sonntag, 2. November 2014 13:15:11 UTC+1 schrieb Garrett DeMarco: > > Also, make sure that the module path is correct. Perhaps > /etc/puppet/modules or other location is not in your puppet.conf.
1 Like