forked from AntoDevOps-Github/Devops-Clarification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPuppet
91 lines (79 loc) · 2.64 KB
/
Puppet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Vagrant.configure("2") do |config|
config.vm.define "puppet" do |puppet|
puppet.vm.box = "ubuntu/xenial64"
puppet.vm.network "private_network", ip: "192.168.0.105"
puppet.vm.hostname = "puppet"
puppet.vm.provider "virtualbox" do |v|
v.memory = 4096
end
end
config.vm.define "node1" do |node1|
node1.vm.box = "ubuntu/xenial64"
node1.vm.network "private_network", ip: "192.168.0.106"
node1.vm.hostname = "node1"
end
config.vm.define "node" do |node|
node.vm.box = "ubuntu/xenial64"
node.vm.network "private_network", ip: "192.168.0.107"
node.vm.hostname = "node"
end
end
//puppet server
$sudo vi /etc/hosts
192.168.0.176 node1
sudo curl -O https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt-get update –y
sudo apt-get install puppetserver
sudo ufw allow 8140
sudo vi /etc/default/puppetserver
sudo systemctl start puppetserver
sudo systemctl status puppetserver
------------------------------------------------------------------------------------------------------------------------
//node
sudo vi /etc/hosts
192.168.0.175 puppet
sudo wget 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 systemctl start puppet
sudo systemctl enable puppet
------------------------------------------------------------------------------------------------------------------------
// puppet server
sudo /opt/puppetlabs/bin/puppet cert list
sudo /opt/puppetlabs/bin/puppet cert list --all //to view all certificate list
sudo /opt/puppetlabs/bin/puppet cert sign node1.domain.name
or
sudo /opt/puppetlabs/bin/puppet cert sign –all
sudo vi /etc/puppetlabs/code/environments/production/manifests/site.pp
------------------------------------------------------------------------------------------------------------------------
//paste below commands in site.pp file
file {'/tmp/tempfile': # resource type file and filename
ensure => present, # make sure it exists
mode => '0644', # file permissions
content => "This is temporary file",
}
or
package {'screen':
ensure => present,
}
package {'git':
ensure => present,
}
package {'wget':
ensure => present,
}
package {'python':
ensure => present,
}
package {'apache2':
ensure => present,
}
package {'ant':
ensure => present,
}
//node
sudo /opt/puppetlabs/bin/puppet agent --test
//to verify all the software installed on node use below command
apt list --installed