Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu20 working, checkouted from master #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -61,4 +61,8 @@ The use of the specific <machine> name is optional.
* `vagrant global-status`
* `facter`
* `sudo tail -50 /var/log/syslog`
* `sudo tail -50 /var/log/puppet/masterhttp.log`
* `sudo tail -50 /var/log/puppet/masterhttp.log`

#### For any ip range (for linux based)
sudo mkdir -p /etc/vbox/
echo "* 0.0.0.0/0 ::/0" | sudo tee -a /etc/vbox/networks.conf
5 changes: 3 additions & 2 deletions Vagrantfile
Expand Up @@ -9,7 +9,8 @@ nodes_config = (JSON.parse(File.read("nodes.json")))['nodes']
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box = "bento/ubuntu-20.04"
config.vm.box_check_update = true

nodes_config.each do |node|
node_name = node[0] # name of node
Expand All @@ -33,7 +34,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.customize ["modifyvm", :id, "--name", node_values[':name']]
end

#config.vm.provision :shell, :path => node_values[':bootstrap']
config.vm.provision :shell, :path => node_values[':bootstrap']
end
end
end
12 changes: 6 additions & 6 deletions bootstrap-master.sh
Expand Up @@ -8,17 +8,17 @@ then
echo "Puppet Master is already installed. Exiting..."
else
# Install Puppet Master
wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb && \
sudo dpkg -i puppetlabs-release-trusty.deb && \
wget https://apt.puppetlabs.com/puppet6-release-focal.deb && \
sudo dpkg -i puppet6-release-focal.deb && \
sudo apt-get update -yq && sudo apt-get upgrade -yq && \
sudo apt-get install -yq puppetmaster git

# Configure /etc/hosts file
echo "" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "# Host config for Puppet Master and Agent Nodes" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.5 puppet" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.10 node01" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.20 node02" | sudo tee --append /etc/hosts 2> /dev/null
echo "10.0.0.101 puppet" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "10.0.0.102 node01" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "10.0.0.103 node02" | sudo tee --append /etc/hosts 2> /dev/null

# Add optional alternate DNS names to /etc/puppet/puppet.conf
sudo sed -i 's/.*\[main\].*/&\ndns_alt_names = puppet/' /etc/puppet/puppet.conf
Expand All @@ -31,5 +31,5 @@ else
sudo puppet module install garystafford-fig

# symlink manifest from Vagrant synced folder location
ln -s /vagrant/site.pp /etc/puppet/manifests/site.pp
# ln -s /vagrant/site.pp /etc/puppet/manifests/site.pp
fi
6 changes: 3 additions & 3 deletions bootstrap-node.sh
Expand Up @@ -24,9 +24,9 @@ else
# Configure /etc/hosts file
echo "" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "# Host config for Puppet Master and Agent Nodes" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.5 puppet" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.10 node01" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "192.168.32.20 node02" | sudo tee --append /etc/hosts 2> /dev/null
echo "10.0.0.101 puppet" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "10.0.0.102 node01" | sudo tee --append /etc/hosts 2> /dev/null && \
echo "10.0.0.103 node02" | sudo tee --append /etc/hosts 2> /dev/null

# Add agent section to /etc/puppet/puppet.conf
echo "" && echo "[agent]\nserver=puppet" | sudo tee --append /etc/puppet/puppet.conf 2> /dev/null
Expand Down
12 changes: 2 additions & 10 deletions nodes.json
Expand Up @@ -2,27 +2,19 @@
"nodes": {
"puppetmaster": {
":name": "Puppet Master",
":ip": "192.168.32.5",
":ip": "10.0.0.101",
":hostname": "puppet",
"ports": [],
":memory": 1024,
":bootstrap": "bootstrap-master.sh"
},
"puppetnode-01": {
":name": "Puppet Node 01",
":ip": "192.168.32.10",
":ip": "10.0.0.102",
":hostname": "node01",
"ports": [],
":memory": 1024,
":bootstrap": "bootstrap-node.sh"
},
"puppetnode-02": {
":name": "Puppet Node 02",
":ip": "192.168.32.20",
":hostname": "node02",
"ports": [],
":memory": 1024,
":bootstrap": "bootstrap-node.sh"
}
}
}