Puppet Dynamic Environments Setup

123 views
Skip to first unread message

wilddog64

unread,
Oct 8, 2013, 10:52:16 AM10/8/13
to puppet...@googlegroups.com
So I follow this document to setup the puppet dynamic environment, and my puppet.conf for dynamic environment settings looks like this,

    # Setup dynamic environments with R10k
    environment = production
    manifest    = $confdir/environments/$environment/manifests/default.pp
    modulepath  = $confdir/environments/$environment/modules:$confdir/environments/$environment/dist:/opt/puppet/share/puppet/modules/

I used r10k to deploy environments to /etc/puppetlabs/puppet/environments, and it looks like this,

/etc/puppetlabs/puppet/environments
└── atlassian_automation
    ├── manfests
    └── modules
        ├── apache_config
        ├── concat
        ├── custom_facts
        ├── firewall
        ├── hiera-config
        ├── inifile
        ├── iptables
        ├── ntp
        ├── stdlib
        └── vision_config

Now I have a node that registered to this puppet master, and I triggered an agent like this,

puppet agent -t --environment atlassian_automation

While there are some catalogs being synced down to the node, the custom modules I wrote above do not get copied over to my node.  I check the puppetmaster.access.log at /var/log/pe-httpd, and I saw these lines,

10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/facter/apache_info.rb HTTP/1.1" 200 329
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/facter/mysql_jdbc_info.rb HTTP/1.1" 200 756
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/facter/concat_basedir.rb HTTP/1.1" 200 220
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/facter/concat_basedir.rb HTTP/1.1" 200 220
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/puppet/util/firewall.rb HTTP/1.1" 200 5982
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/puppet/util/firewall.rb HTTP/1.1" 200 5982
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/puppet/provider/firewall/iptables.rb HTTP/1.1" 200 11225
10.10.20.55 - - [08/Oct/2013:07:46:35 -0700] "GET /atlassian_automation/file_content/plugins/puppet/provider/firewall/iptables.rb HTTP/1.1" 200 11225
10.10.20.55 - - [08/Oct/2013:07:46:36 -0700] "GET /atlassian_automation/file_content/plugins/facter/php_info.rb HTTP/1.1" 200 737
10.10.20.55 - - [08/Oct/2013:07:46:36 -0700] "GET /atlassian_automation/file_content/plugins/puppet/type/firewall.rb HTTP/1.1" 200 22694
10.10.20.55 - - [08/Oct/2013:07:46:37 -0700] "GET /atlassian_automation/file_content/plugins/puppet/type/firewall.rb HTTP/1.1" 200 22694
10.10.20.55 - - [08/Oct/2013:07:46:40 -0700] "POST /atlassian_automation/catalog/chillyhilly.local HTTP/1.1" 200 25398
10.10.20.55 - - [08/Oct/2013:07:46:42 -0700] "GET /atlassian_automation/file_metadatas/modules/pe_mcollective/plugins?links=manage&recurse=true&&&checksum_type=md5 HTTP/1.1" 200 20592
10.10.20.55 - - [08/Oct/2013:07:46:43 -0700] "PUT /atlassian_automation/report/chillyhilly.local HTTP/1.1" 200 26
10.10.20.55 - - [08/Oct/2013:07:46:56 -0700] "GET /atlassian_automation/node/chillyhilly.local? HTTP/1.1" 200 4237
10.10.20.55 - - [08/Oct/2013:07:46:57 -0700] "GET /atlassian_automation/file_metadatas/plugins?links=manage&recurse=true&&ignore=---+%0A++-+%22.svn%22%0A++-+CVS%0A++-+%22.git%22&checksum_type=md5 HTT
P/1.1" 200 50066
10.10.20.55 - - [08/Oct/2013:07:47:00 -0700] "POST /atlassian_automation/catalog/chillyhilly.local HTTP/1.1" 200 25398
10.10.20.55 - - [08/Oct/2013:07:47:01 -0700] "GET /atlassian_automation/file_metadatas/modules/pe_mcollective/plugins?links=manage&recurse=true&&&checksum_type=md5 HTTP/1.1" 200 20592

It looks like puppet master realize the dynamic environment settings, but why my modules does not get down and applied?  Any thought?

Thanks,
Chengkai



chengkai liang

unread,
Oct 8, 2013, 1:06:18 PM10/8/13
to puppet...@googlegroups.com
It seems that instead of add the following line in [master], they have to be in [agent] for dynamic environment to work.  So the document does not reflect what PE 3.x is.

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/UkVUMnHvZWE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

jcbollinger

unread,
Oct 9, 2013, 9:41:25 AM10/9/13
to puppet...@googlegroups.com


On Tuesday, October 8, 2013 12:06:18 PM UTC-5, wilddog64 wrote:
It seems that instead of add the following line in [master], they have to be in [agent] for dynamic environment to work.  So the document does not reflect what PE 3.x is.

On Oct 8, 2013, at 7:52 AM, wilddog64 <ckm....@gmail.com> wrote:

So I follow this document to setup the puppet dynamic environment, and my puppet.conf for dynamic environment settings looks like this,

    # Setup dynamic environments with R10k
    environment = production
    manifest    = $confdir/environments/$environment/manifests/default.pp
    modulepath  = $confdir/environments/$environment/modules:$confdir/environments/$environment/dist:/opt/puppet/share/puppet/modules/


The 'manifest' and 'modulepath' parameters are meaningful only to the master.  It should be harmless to copy them into the [agent] section, but not useful.  On the other hand, the 'environment' setting is meaningful (in different ways) to both agent and master, so if you want to specify a non-default environment for an agent then you do need to specify it in the [agent] section or in the [main] section.  Although that may not be clear from the document you referenced, the doc is consistent with that.  The example config for dynamic environments in fact sets the environment in both the [main] section and the [agent] section, and even in the [master] section as well.


John

Reply all
Reply to author
Forward
0 new messages