2.There are many issues with similar topic here… but none of them has a
short walk through of how to take a simple "class.pp" , import it to
foreman and apply it on hosts.
So far the only way i found to imort and apply such a class with foreman is
by creating a module with the same name of the class
···
On Monday, January 12, 2015 at 1:04:43 PM UTC+2, imneo wrote:
>
> Hello,
>
> 1.Attached a foreman debug file.
>
> 2.There are many issues with similar topic here... but none of them has a
> short walk through of how to take a simple "class.pp" , import it to
> foreman and apply it on hosts.
>
> *3. Env Details:*
>
> OS: redhat
> RELEASE: CentOS release 6.6 (Final)
> FOREMAN: 1.7.1
> RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
> PUPPET: 2.7.25
> DENIALS: 0
>
> *4. Issue:*
>
> Trying to import this simple class to foreman and apply it on managed
> hosts.
>
> class install-zabbix-agent {
> yumrepo { "zabbix":
> baseurl => "
> http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/",
> descr => "zabbix repository",
> enabled => 1,
> gpgcheck => 0
> }
>
>
> file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX":
> mode => 600,
> owner => "root",
> group => "root",
> source =>
> "puppet:///files/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX",
> require => yumrepo["zabbix"]
> }
>
> package {
> "zabbix-agent-2.2.1-1.el6.x86_64":
> ensure => installed,
> require => file["/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX"],
> }
>
> service { "zabbix-agent":
> ensure => running,
> enable => true,
> require => Package["zabbix-agent-2.2.1-1.el6.x86_64"],
> }
>
> file { "/etc/zabbix/zabbix_agentd.conf":
> notify => Service["zabbix-agent"],
> mode => 600,
> owner => "root",
> group => "root",
> content => template('zabbix_agentd.conf.erb')
> }
>
> }
>
>
> 5. This class *works just fine* on all of the puppet registered hosts (
> if i use it manually via puppet agent ).
>
> 6. What is the correct way to import it to foreman and apply it on other
> hosts ?
>
> Thanks
>
>
>
>
Just to be clear , if i have a simple class i should port it to be a module
and import it to foreman ?
That is the recommended way ?
Thank you for your help
···
On Monday, January 12, 2015 at 1:04:43 PM UTC+2, imneo wrote:
>
> Hello,
>
> 1.Attached a foreman debug file.
>
> 2.There are many issues with similar topic here... but none of them has a
> short walk through of how to take a simple "class.pp" , import it to
> foreman and apply it on hosts.
>
> *3. Env Details:*
>
> OS: redhat
> RELEASE: CentOS release 6.6 (Final)
> FOREMAN: 1.7.1
> RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
> PUPPET: 2.7.25
> DENIALS: 0
>
> *4. Issue:*
>
> Trying to import this simple class to foreman and apply it on managed
> hosts.
>
> class install-zabbix-agent {
> yumrepo { "zabbix":
> baseurl => "
> http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/",
> descr => "zabbix repository",
> enabled => 1,
> gpgcheck => 0
> }
>
>
> file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX":
> mode => 600,
> owner => "root",
> group => "root",
> source =>
> "puppet:///files/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX",
> require => yumrepo["zabbix"]
> }
>
> package {
> "zabbix-agent-2.2.1-1.el6.x86_64":
> ensure => installed,
> require => file["/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX"],
> }
>
> service { "zabbix-agent":
> ensure => running,
> enable => true,
> require => Package["zabbix-agent-2.2.1-1.el6.x86_64"],
> }
>
> file { "/etc/zabbix/zabbix_agentd.conf":
> notify => Service["zabbix-agent"],
> mode => 600,
> owner => "root",
> group => "root",
> content => template('zabbix_agentd.conf.erb')
> }
>
> }
>
>
> 5. This class *works just fine* on all of the puppet registered hosts (
> if i use it manually via puppet agent ).
>
> 6. What is the correct way to import it to foreman and apply it on other
> hosts ?
>
> Thanks
>
>
>
>
The smart proxy only scans manifests in the modulepath, it doesn't check
the manifestdir, which is why it won't be imported automatically -
though conceivably it could.
That isn't a recommended or usual approach to using Puppet, so using a
module layout is a far better idea.
Note that hyphens in a class name are invalid and may cause problems, so
use underscores instead:
···
--
Dominic Cleal
Red Hat Engineering
On 12/01/15 12:29, imneo wrote:
So far the only way i found to imort and apply such a class with foreman
is by creating a module with the same name of the class
On Monday, January 12, 2015 at 1:04:43 PM UTC+2, imneo wrote:
Hello,
1.Attached a foreman debug file.
2.There are many issues with similar topic here... but none of them
has a short walk through of how to take a simple "class.pp" , import
it to foreman and apply it on hosts.
*_3. Env Details:_*
OS: redhat
RELEASE: CentOS release 6.6 (Final)
FOREMAN: 1.7.1
RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
PUPPET: 2.7.25
DENIALS: 0
*_4. Issue:_*
*_
_*
Trying to import this simple class to foreman and apply it on
managed hosts.
>
class install-zabbix-agent {
yumrepo { "zabbix":
baseurl =>
"http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/
<http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/>",
descr => "zabbix repository",
enabled => 1,
gpgcheck => 0
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX":
mode => 600,
owner => "root",
group => "root",
source =>
"puppet:///files/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX",
require => yumrepo["zabbix"]
}
package {
"zabbix-agent-2.2.1-1.el6.x86_64":
ensure => installed,
require => file["/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX"],
}
service { "zabbix-agent":
ensure => running,
enable => true,
require => Package["zabbix-agent-2.2.1-1.el6.x86_64"],
}
file { "/etc/zabbix/zabbix_agentd.conf":
notify => Service["zabbix-agent"],
mode => 600,
owner => "root",
group => "root",
content => template('zabbix_agentd.conf.erb')
}
}
>
5. This class *works just fine* on all of the puppet registered
hosts ( if i use it manually via puppet agent ).
6. What is the correct way to import it to foreman and apply it on
other hosts ?
Thanks
Just to be clear , if i have a simple class i should port it to be a
module and import it to foreman ?
That is the recommended way ?
Thank you for your help
On Monday, January 12, 2015 at 1:04:43 PM UTC+2, imneo wrote:
Hello,
1.Attached a foreman debug file.
2.There are many issues with similar topic here... but none of them
has a short walk through of how to take a simple "class.pp" , import
it to foreman and apply it on hosts.
*_3. Env Details:_*
OS: redhat
RELEASE: CentOS release 6.6 (Final)
FOREMAN: 1.7.1
RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
PUPPET: 2.7.25
DENIALS: 0
*_4. Issue:_*
*_
_*
Trying to import this simple class to foreman and apply it on
managed hosts.
>
class install-zabbix-agent {
yumrepo { "zabbix":
baseurl =>
"http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/
<http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/>",
descr => "zabbix repository",
enabled => 1,
gpgcheck => 0
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX":
mode => 600,
owner => "root",
group => "root",
source =>
"puppet:///files/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX",
require => yumrepo["zabbix"]
}
package {
"zabbix-agent-2.2.1-1.el6.x86_64":
ensure => installed,
require => file["/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX"],
}
service { "zabbix-agent":
ensure => running,
enable => true,
require => Package["zabbix-agent-2.2.1-1.el6.x86_64"],
}
file { "/etc/zabbix/zabbix_agentd.conf":
notify => Service["zabbix-agent"],
mode => 600,
owner => "root",
group => "root",
content => template('zabbix_agentd.conf.erb')
}
}
>
5. This class *works just fine* on all of the puppet registered
hosts ( if i use it manually via puppet agent ).
6. What is the correct way to import it to foreman and apply it on
other hosts ?
Thanks