Skip to content

Commit e1b323c

Browse files
Add files via upload
1 parent 1bce043 commit e1b323c

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

Puppet installation

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
PUPPET INSTALLATION
2+
3+
PUPPET INSTALLATION ON UBUNTU
4+
5+
Installing Puppet Master
6+
Step 1: Run the following commands for installing Puppet Master
7+
$ sudo apt-get update
8+
$ sudo apt-get install wget
9+
$ wget https://apt.puppetlabs.com/puppet-release-bionic.deb
10+
$ sudo dpkg -i puppet-release-bionic.deb
11+
$ sudo apt-get update
12+
13+
$ sudo apt-get install puppet-master
14+
$ sudo systemctl status puppet-master.service
15+
16+
Add the following lines in the puppet-master configuration file
17+
Next open port 8140 on the Puppet Master’s firewall
18+
$ sudo nano /etc/default/puppet-master
19+
JAVA_ARGS="-Xms512m Xmx512m"
20+
$ sudo systemctl restart puppet-master
21+
$ sudo ufw allow 8140/tcp
22+
23+
Installing Puppet Agent
24+
25+
Step 2: Run the following commands for installing Puppet Agent
26+
27+
$ sudo apt-get update
28+
$ sudo apt-get install wget
29+
$ wget https://apt.puppetlabs.com/puppet-release-bionic.deb
30+
$ sudo dpkg -i puppet-release-bionic.deb
31+
$ sudo apt-get install puppet
32+
$ sudo nano /etc/hosts
33+
add ip address of the master
34+
$ sudo systemctl start puppet
35+
$ sudo systemctl enable puppet
36+
37+
38+
Step 3: Make changes to the hosts file which exists in /etc/hosts. And add the Puppet
39+
Master IP address along with the name “puppet”
40+
41+
$ sudo nano /etc/hosts
42+
43+
Step 4: Create the following directory path:
44+
45+
$ sudo mkdir -p /etc/puppet/code/environments/production/manifests
46+
47+
48+
Configuring Puppet Slave
49+
50+
Step 1: Add the entry for Puppet Master in /etc/hosts
51+
52+
Step 2: Finally start the Puppet agent by using the following command. Also, enable the
53+
service, so that it starts when the computer starts
54+
55+
$ sudo systemctl start puppet
56+
$ sudo systemctl enable puppet
57+
58+
59+
On Master
60+
61+
$ sudo puppet cert list
62+
63+
Step 2: Finally, sign the listed certificate using the following command:
64+
$ sudo puppet cert sign --all
65+
66+
On master machine create /etc/puppet/code/environments/production/manifests/site.pp
67+
68+
node default{
69+
70+
package {'nginx':
71+
ensure => installed,
72+
}
73+
74+
file { '/tmp/status.txt':
75+
76+
content => 'installed',
77+
mode => '0644',
78+
}
79+
}
80+
81+
Goto client machine and run the command
82+
puppet agent --test
83+
84+
85+
---Variable
86+
87+
node default{
88+
89+
package {'nginx':
90+
ensure => installed,
91+
}
92+
93+
$test = "ok"
94+
95+
file { '/tmp/status.txt':
96+
97+
content => $test,
98+
mode => '0644',
99+
}
100+
}
101+
102+
103+
---------------
104+
Loops
105+
-------------
106+
node default{
107+
108+
$packages = ['apache2','mysql-server']
109+
110+
package {$packages:
111+
ensure => installed,
112+
113+
}
114+
}
115+

0 commit comments

Comments
 (0)