0
votes

I am trying to keep puppet master and client/agent on one machine. I have been trying this for last 2 days and I am almost close to finishing it.

1) started puppet master "service puppetmaster start". Its successful 2) started puppet agent "service puppet start. Its successful 3) When I try puppet agent --test. see the errors below

This is the error I am getting when I try "puppet agent --test". I tried setting different values for environment in puppet.conf file and also passing from command line args for environment but nothing seems to be working.

Warning: Local environment: "production" doesn't match server specified environment "none", restarting agent run with environment "none"

I googled and tried what people said, but no use. It might work if I try agent from one machine and master on the other. But I want to make it work on one machine.

2
How have you installed the puppet components? using root or another user? - Miad Abrin
what puppet components? yes I am doing with root access - Kenshin
By components I mean puppetserver and puppet agent. If you want to make it work on one machine you don't use puppet agent -t. you should use puppet apply. here is a reference https://docs.puppet.com/puppet/latest/reference/man/apply.html - Miad Abrin
I tried puppet apply -t. It's not giving any logs, keep waiting... :( - Kenshin
what will be the expected output - Kenshin

2 Answers

1
votes

If you want to make it work on one machine you don't use puppet agent -t. you should use puppet apply. here is a reference https://docs.puppet.com/puppet/latest/re‌​ference/man/‌​apply.html

0
votes

you can write a small script which will be having puppet apply command with farther argument (of course) and you can name it whatever you want (e.g: Papply) and run it every time whenever you want to run puppet agent -t. puppet agent -t is not preferred for stand alone Puppet Server & Clint environment. https://docs.puppet.com/puppet/4.6/reference/architecture.html