Setting up different environments like development,testing and production

asked 2015-07-02 12:17:29 -0500

Tushir Pruthi gravatar image

I have configured Puppet Master (Learning VM). I have created two nodes centos and ubuntu. By default it is configured for environment production. But I want to move my ubuntu node to environment testing.

But I am getting below error when I am executing puppet agent -t

Warning: Local environment: "testing" doesn't match server specified node environment "production", switching agent to "production".

Below are the details ie puppet.conf (master and node), directory structure for environment on puppet master, site.pp. Puppet Master (Learning VM downloaded) [main] certname = learning.puppetlabs.vm vardir = /var/opt/lib/pe-puppet logdir = /var/log/pe-puppet rundir = /var/run/pe-puppet basemodulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules environmentpath = /etc/puppetlabs/puppet/environments server = learning.puppetlabs.vm user = pe-puppet group = pe-puppet archivefiles = true archivefileserver = learning.puppetlabs.vm modulegroups = base+peonly defaultmanifest = /etc/puppetlabs/puppet/manifests/main.pp [agent] report = true classfile = $vardir/classes.txt localconfig = $vardir/localconfig graph = true pluginsync = true environment = production

environmenttimeout=0 [master] nodeterminus = classifier caserver = learning.puppetlabs.vm reports = console,puppetdb storeconfigs = true storeconfigsbackend = puppetdb certname = learning.puppetlabs.vm server = learning.puppetlabs.vm alwayscachefeatures = true

Puppet.conf on Agent Side tushir@ubuntu:/etc/puppetlabs/puppet$ cat puppet.conf [main] vardir = /var/opt/lib/pe-puppet logdir = /var/log/pe-puppet rundir = /var/run/pe-puppet basemodulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules user = pe-puppet group = pe-puppet archive_files = true environment = testing

[agent] report = true classfile = $vardir/classes.txt localconfig = $vardir/localconfig graph = true pluginsync = true environment = testing server = learning.puppetlabs.vm certname = ubuntu.localdomain

On Puppet Master [root@learning /etc/puppetlabs/puppet/environments]# tree testing/ testing/ ├── manifests │ └── site.pp └── modules ├── cowsayings │ ├── manifests │ │ └── init.pp │ └── tests │ └── init.pp ├── lvmguide │ ├── manifests │ │ └── init.pp │ └── tests │ └── init.pp ├── manifests │ └── site.pp └── sequence ├── manifests │ └── init.pp ├── templates └── tests └── init.pp

[root@learning /etc/puppetlabs/puppet/environments/testing/manifests]# cat site.pp

site.pp

This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point

used when an agent connects to a master and asks for an updated configuration.

#

Global objects like filebuckets and resource defaults should go in this file,

as should the default node definition. (The default node can be omitted

if you use the console and don't define any other nodes in site.pp. See

http://docs.puppetlabs.com/guides/lan... for more on

node definitions.)

Active Configurations

PRIMARY FILEBUCKET

This configures puppet agent and puppet inspect to back up file contents when

they run. The Puppet Enterprise console needs this to display file contents

and differences.

Define filebucket 'main':

filebucket { 'main': server => 'learning.puppetlabs.vm', path => false, }

Make filebucket 'main' the default backup location for all File resources:

File { backup => 'main' }

DEFAULT NODE

Node definitions in this file are merged with node data from the console. See

http://docs.puppetlabs.com/guides/lan... for more on

node definitions.

The default node definition matches any node lacking a more specific node

definition. If there are no other nodes ...

(more)
edit retag flag offensive close merge delete

Comments

my karma is too low to edit your post, so please please edit your formatting to avoid hurting my eyes...

sinned gravatar imagesinned ( 2015-07-07 03:16:58 -0500 )edit