Last active
February 26, 2019 11:29
-
-
Save sonalkr132/46e688907234b92746cf04a1997a44e9 to your computer and use it in GitHub Desktop.
Setting up puppet master and agent using vagrant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install vagrant | |
sudo apt-get install virtualbox | |
vagrant box add ubuntu/xenial64 | |
vagrant plugin install vagrant-hostmanager | |
mkdir vagrant_dir | |
cd vagrant_dir/ | |
vagrant init | |
vim Vagrantfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -O https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb | |
sudo dpkg -i puppetlabs-release-pc1-xenial.deb | |
sudo apt-get update | |
sudo apt-get install puppet-agent | |
sudo vim /etc/hosts | |
# 10.0.0.10 puppet | |
sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true | |
sudo /opt/puppetlabs/bin/puppet agent -t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -O https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb | |
sudo dpkg -i puppetlabs-release-pc1-xenial.deb | |
sudo apt-get update | |
sudo apt-get install puppetserver | |
sudo service puppetserver start | |
sudo /opt/puppetlabs/bin/puppet cert list | |
sudo /opt/puppetlabs/bin/puppet cert sign agent1.example.com | |
sudo vim /etc/default/puppetserver | |
# JAVA_ARGS="-Xms512m -Xmx1024m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.hostmanager.enable = true | |
config.hostmanager.ignore_private_ip = false | |
config.hostmanager.include_offline = true | |
config.vm.define "puppet" do |puppet| | |
puppet.vm.box = "ubuntu/xenial64" | |
puppet.vm.hostname = "puppet.example.com" | |
puppet.vm.network :private_network, ip: "10.0.0.10" | |
puppet.hostmanager.aliases = %w(puppet) | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
end | |
end | |
config.vm.define "agent1" do |agent1| | |
agent1.vm.box = "ubuntu/xenial64" | |
agent1.vm.hostname = "agent1.example.com" | |
agent1.hostmanager.aliases = %w(agent1) | |
agent1.vm.network :private_network, ip: "10.0.0.11" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment