My goal is to have one or two nodes and one puppeteer. I used a bash script to provide each node with a puppetlabs repository and install the latest puppet and / or puppet master. But every time I try to run puppet agent --test in node, it returns this error:
root@vm :~
- I confirmed that the puppeteer is working.
- I don't turn on node until the wizard gets up.
- Running
puppet cert list does not display any certificates awaiting the approval of the puppet master. - My / etc / hosts files have the correct IP addresses and hostnames.
- /etc/puppet/puppet.conf looks right.
- I can do a ping node from the wizard and vice versa.
iptables --list no firewall rules are displayed.
Unless Vagrant / Virtualbox can understand how to deal with port 8140? The error says “connection refused”, so I thought it was a firewall problem. But there is no firewall ...
So where did I mess up?
Here is my Vagrantfile:
Vagrant.configure("2") do |config| config.vm.define :puppetmaster do |puppetmaster| puppetmaster.vm.box = "ubuntu-server-12042-x64-vbox4210-nocm" puppetmaster.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box" puppetmaster.vm.network :private_network, ip: "192.168.77.1" #puppetmaster.vm.network :forwarded_port, guest: 80, host: 20001 #puppetmaster.vm.network :forwarded_port, guest: 443, host: 24431 #puppetmaster.vm.network :forwarded_port, guest: 22, host: 20022 puppetmaster.vm.hostname = "vm.puppetmaster.lab" puppetmaster.vm.provision :shell, :path => "master-bootstrap.sh" puppetmaster.vm.synced_folder "modules/", "/etc/puppet/modules" puppetmaster.vm.synced_folder "manifests/", "/etc/puppet/manifests" end config.vm.define :alpha do |alpha| alpha.vm.box = "ubuntu-server-12042-x64-vbox4210-nocm" alpha.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box" alpha.vm.network :private_network, ip: "192.168.77.2" #alpha.vm.network :forwarded_port, guest: 22, host: 20023 alpha.vm.hostname = "vm.alpha.lab" alpha.vm.provision :shell, :path => "alpha-bootstrap.sh" end config.vm.define :beta do |beta| beta.vm.box = "ubuntu-server-12042-x64-vbox4210-nocm" beta.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box" beta.vm.network :private_network, ip: "192.168.77.3" #beta.vm.network :forwarded_port, guest: 22, host: 20024 beta.vm.hostname = "vm.beta.lab" beta.vm.provision :shell, :path => "beta-bootstrap.sh" end end
My node bootstrap bash script:
#!/usr/bin/env bash wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb dpkg -i puppetlabs-release-precise.deb apt-get update
My workshop loading a bash script:
#!/usr/bin/env bash wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb dpkg -i puppetlabs-release-precise.deb apt-get update
Please note that I am using a slightly modified puppet module from Pro Puppet to set up / install the puppet / puppeteer. So I run the puppet apply in the bootstrap script.
Edit I can get two vm messages if I use: public_network and let my dhcp server jobs assign IP addresses. “Of course, this is not ideal, as it means that I can’t just use the address 192.xxx in a private local virtual network. I need to configure the host files manually before starting any puppets. But at least I know the problem is with using: private_network.
Edit 2 I just tried using the puppet / firewall module to make the 8140 open on the puppetmaster vm firewall, just in case I was missing something when I used to check the firewall. This allowed me to run a puppet on this vm. But when I tried to use alpha vm, it had the same connection as the error. Therefore, I doubt that the firewall has anything to do with it.
Edit 3 The private network option installs a second network card in the virtual machine. The first network adapter is NAT'd, the second is that it receives the static IP address that I assign.
Puppet plays on both network adapters. (At least as far as I can tell.)
The 192.xxx ip addresses are unique to these virtual machines. This range is not used anywhere else.