forked from rskTech/DevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPuppet installation
115 lines (75 loc) · 2.37 KB
/
Puppet installation
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
PUPPET INSTALLATION
PUPPET INSTALLATION ON UBUNTU
Installing Puppet Master
Step 1: Run the following commands for installing Puppet Master
$ sudo apt-get update
$ sudo apt-get install wget
$ wget https://apt.puppetlabs.com/puppet-release-bionic.deb
$ sudo dpkg -i puppet-release-bionic.deb
$ sudo apt-get update
$ sudo apt-get install puppet-master
$ sudo systemctl status puppet-master.service
Add the following lines in the puppet-master configuration file
Next open port 8140 on the Puppet Master’s firewall
$ sudo nano /etc/default/puppet-master
JAVA_ARGS="-Xms512m Xmx512m"
$ sudo systemctl restart puppet-master
$ sudo ufw allow 8140/tcp
Installing Puppet Agent
Step 2: Run the following commands for installing Puppet Agent
$ sudo apt-get update
$ sudo apt-get install wget
$ wget https://apt.puppetlabs.com/puppet-release-bionic.deb
$ sudo dpkg -i puppet-release-bionic.deb
$ sudo apt-get install puppet
$ sudo nano /etc/hosts
add ip address of the master
$ sudo systemctl start puppet
$ sudo systemctl enable puppet
Step 3: Make changes to the hosts file which exists in /etc/hosts. And add the Puppet
Master IP address along with the name “puppet”
$ sudo nano /etc/hosts
Step 4: Create the following directory path:
$ sudo mkdir -p /etc/puppet/code/environments/production/manifests
Configuring Puppet Slave
Step 1: Add the entry for Puppet Master in /etc/hosts
Step 2: Finally start the Puppet agent by using the following command. Also, enable the
service, so that it starts when the computer starts
$ sudo systemctl start puppet
$ sudo systemctl enable puppet
On Master
$ sudo puppet cert list
Step 2: Finally, sign the listed certificate using the following command:
$ sudo puppet cert sign --all
On master machine create /etc/puppet/code/environments/production/manifests/site.pp
node default{
package {'nginx':
ensure => installed,
}
file { '/tmp/status.txt':
content => 'installed',
mode => '0644',
}
}
Goto client machine and run the command
puppet agent --test
---Variable
node default{
package {'nginx':
ensure => installed,
}
$test = "ok"
file { '/tmp/status.txt':
content => $test,
mode => '0644',
}
}
---------------
Loops
-------------
node default{
$packages = ['apache2','mysql-server']
package {$packages:
ensure => installed,
}
}