Foreman vs Puppet environments

> Hi!
>
> I'm a bit confused with the concept of environment. The thing is, when I
> import classes from the puppet to Foreman, the environment [master]
> appears in Forman and have all classes of puppet. All the hosts, as
> expected included in the [production] environment.So, formeen offers me to
> remove [production] and use [master] environment. I tried to rename the environment
> from [master] to [production] in /etc/puppet/puppet.conf, but agents stopped
> receiving catalog.
> I would like to hear a brief explanation of how it all unite in one
> environment.

I'm not really sure what the issue is (sounds like a bug / issue with
puppet.conf) but foreman environments and puppet environments are the same.

could you provide more info about your setup? puppet version, puppet.conf
content etc.

Ohad

··· On Mon, Dec 31, 2012 at 6:54 PM, Alexander Litvinenko wrote:


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/RTIAF5yEZq4J.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Thanks for your answer, Ohad.

Well, i'll try to describe my env. Because it's brand new setup, we decided
to use last available versions of software - at this time this vervions
used:

puppet 3.0.2-1puppetlabs1
puppetmaster 3.0.2-1puppetlabs1
puppetdb 1.0.5-1puppetlabs1

foreman, foreman-pgsql, foreman-proxy fresh nightly, because of issues with
last stable and puppet 3.x
os - debian squeeze everywhere (master, agent hosts)

Foreman and Puppet is running under last passenger (3.0.18) and apache2

So problem (maybe not) is in environments. In my puppet.conf on master i
have no special env, only [master] section:
[master]

ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY

modulepath=/etc/puppet/modules

storeconfigs = true
storeconfigs_backend = puppetdb

external_nodes = /etc/puppet/node.rb
node_terminus = exec

And when i try to import classes from puppet to foreman, script founds only
one env - master with all existing classes from puppet, and recommends to
delete only one empty environment in foreman - production (there is no
classes yet in there). Here is output from import script:

cd /usr/share/foreman && rake puppet:import:puppet_classes
RAILS_ENV=production
Libvirt binding are missing - hypervisor management is disabled
Evaluating possible changes to your installation
Scheduled changes to your environment
Create/update environments
master :
{"pxp_ssh_authorized_key::presentuser"=>{"new"=>{"accounts"=>["root"]}},
"stdlib::stages"=>{"new"=>{}}, "ssh::client::config"=>{"new"=>{}},
"stdlib"=>{"new"=>{}}, "sudo"=>{"new"=>{"purge"=>true,
"autoupgrade"=>false, "package"=>"${$sudo::params::package}",
"config_dir"=>"${$sudo::params::config_dir}", "config_file_replace"=>true,
"config_file"=>"${$sudo::params::config_file}", "ensure"=>"present",
"source"=>"${$sudo::params::source}"}}, "vim::params"=>{"new"=>{}},
"timezone::params"=>{"new"=>{}}, "ssh::server"=>{"new"=>{}},
"apt::debian::unstable"=>{"new"=>{}},
"locales"=>{"new"=>{"autoupgrade"=>true, "locales"=>["en_US.UTF-8 UTF-8",
"ru_RU.UTF-8 UTF-8"],
"locale_gen_cmd"=>"${$locales::params::locale_gen_cmd}",
"package"=>"${$locales::params::package}",
"config_file"=>"${$locales::params::config_file}", "ensure"=>"present"}},
"pxp_ssh_authorized_key::absentuser"=>{"new"=>{"accounts"=>["root"]}},
"apt::release"=>{"new"=>{"release_id"=>nil}}, "apt::params"=>{"new"=>{}},
"vim"=>{"new"=>{"autoupgrade"=>false,
"package"=>"${$vim::params::package}",
"set_as_default"=>"${$vim::params::set_as_default}", "ensure"=>"present",
"test_editor_set"=>"${$vim::params::test_editor_set}",
"set_editor_cmd"=>"${$vim::params::set_editor_cmd}"}},
"ssh::server::config"=>{"new"=>{}}, "apt"=>{"new"=>{"proxy_port"=>"8080",
"disable_keys"=>nil, "proxy_host"=>false, "purge_sources_list_d"=>false,
"purge_preferences_d"=>false, "purge_sources_list"=>false,
"always_apt_update"=>false}},
"timezone"=>{"new"=>{"zoneinfo_dir"=>"${$timezone::params::zoneinfo_dir}",
"autoupgrade"=>false, "timezone"=>"UTC",
"package"=>"${$timezone::params::package}",
"config_file"=>"${$timezone::params::config_file}", "ensure"=>"present"}},
"ssh::params"=>{"new"=>{}},
"apt::backports"=>{"new"=>{"location"=>"${$apt::params::backports_location}",
"release"=>"${$::lsbdistcodename}"}}, "ssh::client"=>{"new"=>{}},
"apt::update"=>{"new"=>{}}, "ssh::server::install"=>{"new"=>{}},
"ssh::knownhosts"=>{"new"=>{}}, "ssh"=>{"new"=>{}},
"ssh::hostkeys"=>{"new"=>{}},
"pxp_ssh_authorized_key::testmannt"=>{"new"=>{"accounts"=>["root"]}},
"pxp_ssh_authorized_key::test"=>{"new"=>{}},
"pxp_ssh_authorized_key::hetzeneckerl"=>{"new"=>{"accounts"=>["root"]}},
"apt::debian::testing"=>{"new"=>{}}, "sudo::params"=>{"new"=>{}},
"ssh::server::service"=>{"new"=>{}}, "ssh::client::install"=>{"new"=>{}}}
Delete environments
production : Remove environment

Proceed with these modifications? <yes|no>

If you need more information, please tell me what exactly is needed.

Many thanks!

··· понедельник, 31 декабря 2012 г., 20:57:01 UTC+2 пользователь ohad написал: > > > > > On Mon, Dec 31, 2012 at 6:54 PM, Alexander Litvinenko <a.l...@gmail.com > > wrote: > >> Hi! >> >> I'm a bit confused with the concept of environment. The thing is, when I >> import classes from the puppet to Foreman, the environment [master] >> appears in Forman and have all classes of puppet. All the hosts, as >> expected included in the [production] environment.So, formeen offers me to >> remove [production] and use [master] environment. I tried to rename the environment >> from [master] to [production] in /etc/puppet/puppet.conf, but agents stopped >> receiving catalog. >> I would like to hear a brief explanation of how it all unite in one >> environment. > > > I'm not really sure what the issue is (sounds like a bug / issue with > puppet.conf) but foreman environments and puppet environments are the same. > > could you provide more info about your setup? puppet version, puppet.conf > content etc. > > Ohad > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/foreman-users/-/RTIAF5yEZq4J. >> To post to this group, send email to forema...@googlegroups.com >> . >> To unsubscribe from this group, send email to >> foreman-user...@googlegroups.com . >> For more options, visit this group at >> http://groups.google.com/group/foreman-users?hl=en. >> > >

> Thanks for your answer, Ohad.
>
> Well, i'll try to describe my env. Because it's brand new setup, we
> decided to use last available versions of software - at this time this
> vervions used:
>
> puppet 3.0.2-1puppetlabs1
> puppetmaster 3.0.2-1puppetlabs1
> puppetdb 1.0.5-1puppetlabs1
>
> foreman, foreman-pgsql, foreman-proxy fresh nightly, because of issues
> with last stable and puppet 3.x
> os - debian squeeze everywhere (master, agent hosts)
>
I'm not sure if nightilies build work correctly, try to use the rc repo,
which was latest updated a few days ago.

> Foreman and Puppet is running under last passenger (3.0.18) and apache2
>
> So problem (maybe not) is in environments. In my puppet.conf on master i
> have no special env, only [master] section:
> [master]
>
> ssl_client_header = SSL_CLIENT_S_DN
> ssl_client_verify_header = SSL_CLIENT_VERIFY
>
> modulepath=/etc/puppet/modules
>
> storeconfigs = true
> storeconfigs_backend = puppetdb
>
> external_nodes = /etc/puppet/node.rb
> node_terminus = exec
>
> I think you are missing the environment definition, e.g. something like

[production]
modulepath = /etc/puppet/modules/production

[development]
modulepath = /etc/puppetmodules/development;/etc/puppet/modules/production

or something similar…

Ohad

··· On Tue, Jan 1, 2013 at 2:03 PM, Alexander Litvinenko wrote:

And when i try to import classes from puppet to foreman, script founds
only one env - master with all existing classes from puppet, and recommends
to delete only one empty environment in foreman - production (there is no
classes yet in there). Here is output from import script:

cd /usr/share/foreman && rake puppet:import:puppet_classes
RAILS_ENV=production
Libvirt binding are missing - hypervisor management is disabled
Evaluating possible changes to your installation
Scheduled changes to your environment
Create/update environments
master :
{“pxp_ssh_authorized_key::presentuser”=>{“new”=>{“accounts”=>[“root”]}},
“stdlib::stages”=>{“new”=>{}}, “ssh::client::config”=>{“new”=>{}},
“stdlib”=>{“new”=>{}}, “sudo”=>{“new”=>{“purge”=>true,
“autoupgrade”=>false, “package”=>"${$sudo::params::package}",
“config_dir”=>"${$sudo::params::config_dir}", “config_file_replace”=>true,
“config_file”=>"${$sudo::params::config_file}", “ensure”=>“present”,
“source”=>"${$sudo::params::source}"}}, “vim::params”=>{“new”=>{}},
“timezone::params”=>{“new”=>{}}, “ssh::server”=>{“new”=>{}},
“apt::debian::unstable”=>{“new”=>{}},
“locales”=>{“new”=>{“autoupgrade”=>true, “locales”=>[“en_US.UTF-8 UTF-8”,
“ru_RU.UTF-8 UTF-8”],
“locale_gen_cmd”=>"${$locales::params::locale_gen_cmd}",
“package”=>"${$locales::params::package}",
“config_file”=>"${$locales::params::config_file}", “ensure”=>“present”}},
“pxp_ssh_authorized_key::absentuser”=>{“new”=>{“accounts”=>[“root”]}},
“apt::release”=>{“new”=>{“release_id”=>nil}}, “apt::params”=>{“new”=>{}},
“vim”=>{“new”=>{“autoupgrade”=>false,
“package”=>"${$vim::params::package}",
“set_as_default”=>"${$vim::params::set_as_default}", “ensure”=>“present”,
“test_editor_set”=>"${$vim::params::test_editor_set}",
“set_editor_cmd”=>"${$vim::params::set_editor_cmd}"}},
“ssh::server::config”=>{“new”=>{}}, “apt”=>{“new”=>{“proxy_port”=>“8080”,
“disable_keys”=>nil, “proxy_host”=>false, “purge_sources_list_d”=>false,
“purge_preferences_d”=>false, “purge_sources_list”=>false,
“always_apt_update”=>false}},
“timezone”=>{“new”=>{“zoneinfo_dir”=>"${$timezone::params::zoneinfo_dir}",
“autoupgrade”=>false, “timezone”=>“UTC”,
“package”=>"${$timezone::params::package}",
“config_file”=>"${$timezone::params::config_file}", “ensure”=>“present”}},
“ssh::params”=>{“new”=>{}},
“apt::backports”=>{“new”=>{“location”=>"${$apt::params::backports_location}",
“release”=>"${$::lsbdistcodename}"}}, “ssh::client”=>{“new”=>{}},
“apt::update”=>{“new”=>{}}, “ssh::server::install”=>{“new”=>{}},
“ssh::knownhosts”=>{“new”=>{}}, “ssh”=>{“new”=>{}},
“ssh::hostkeys”=>{“new”=>{}},
“pxp_ssh_authorized_key::testmannt”=>{“new”=>{“accounts”=>[“root”]}},
“pxp_ssh_authorized_key::test”=>{“new”=>{}},
“pxp_ssh_authorized_key::hetzeneckerl”=>{“new”=>{“accounts”=>[“root”]}},
“apt::debian::testing”=>{“new”=>{}}, “sudo::params”=>{“new”=>{}},
“ssh::server::service”=>{“new”=>{}}, “ssh::client::install”=>{“new”=>{}}}
Delete environments
production : Remove environment

Proceed with these modifications? <yes|no>

If you need more information, please tell me what exactly is needed.

Many thanks!

понедельник, 31 декабря 2012 г., 20:57:01 UTC+2 пользователь ohad написал:

On Mon, Dec 31, 2012 at 6:54 PM, Alexander Litvinenko a.l...@gmail.comwrote:

Hi!

I’m a bit confused with the concept of environment. The thing is, when I
import classes from the puppet to Foreman, the environment [master]
appears in Forman and have all classes of puppet. All the hosts, as
expected included in the [production] environment.So, formeen offers me to
remove [production] and use [master] environment. I tried to rename the environment
from [master] to [production] in /etc/puppet/puppet.conf, but agents stopped
receiving catalog.
I would like to hear a brief explanation of how it all unite in one
environment.

I’m not really sure what the issue is (sounds like a bug / issue with
puppet.conf) but foreman environments and puppet environments are the same.

could you provide more info about your setup? puppet version, puppet.conf
content etc.

Ohad


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To view this discussion on the web visit https://groups.google.com/d/**
msg/foreman-users/-/RTIAF5yEZq4Jhttps://groups.google.com/d/msg/foreman-users/-/RTIAF5yEZq4J
.
To post to this group, send email to forema...@googlegroups.com
.
To unsubscribe from this group, send email to foreman-user…@**
googlegroups.com.

For more options, visit this group at http://groups.google.com/**
group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en
.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/TSE1UMD1AbsJ.

To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Today I was reading through this page:

http://docs.puppetlabs.com/guides/environment.html

and I saw this:

"""
In Puppet 3 and later, the environment set by the ENC will override the
environment from the agent node’s config file. If no environment is
provided by the ENC, the value from the node’s config file will be used.

Note: In Puppet 2.7 and earlier, ENC-set environments are not
authoritative, and using them results in nodes using a mixture of two
environments — the ENC environment wins during compilation, and the
agent environment wins during file downloads. If you need to centrally
control your nodes environments, you should upgrade to Puppet 3 as soon
as is practical.

"""

I am not sure if this helps (I guess not), but pasting here. Maybe
something has changed in Puppet 3, I know Foreman uses ENC… :slight_smile:

LZ

··· On Tue, Jan 01, 2013 at 02:42:42PM +0200, Ohad Levy wrote: > On Tue, Jan 1, 2013 at 2:03 PM, Alexander Litvinenko wrote: > > > Thanks for your answer, Ohad. > > > > Well, i'll try to describe my env. Because it's brand new setup, we > > decided to use last available versions of software - at this time this > > vervions used: > > > > puppet 3.0.2-1puppetlabs1 > > puppetmaster 3.0.2-1puppetlabs1 > > puppetdb 1.0.5-1puppetlabs1


Later,

Lukas “lzap” Zapletal
#katello #systemengine

>
> I think you are missing the environment definition, e.g. something like
>
> [production]
> modulepath = /etc/puppet/modules/production
>
> [development]
> modulepath = /etc/puppetmodules/development;/etc/puppet/modules/production
>
> or something similar…
>

That's what I did with my 2.6 setup and it worked.