Instalación del cliente
Requisitos previos
Configuración del hostname
Proceda a configurar el hostname en la máquina cliente, es indiferente el nombre que le ponga, pero ha de ser un nonmbre no usado en la red local
Cliente 1 que será un servidor Web Nginx
hostnamectl set-hostname nginx-01
Cliente 2 que será un servidor de MariaDB
hostnamectl set-hostname nginx-01
Cliente 3 que será un equipo de un usuario
hostnamect set-hostname laptop-guille
Configuración del fichero hosts
Si el servidor no tiene un registro DNS en el servidor DNS local o de la empresa, deberá añadir las siguientes lineas en el fichero /etc/hosts
de la máquina cliente. Suponiendo que la IP del servidor es 192.168.0.10
, su hostname es my-puppet-server
y que el dominio local es home.local
echo "192.168.0.3 puppet-master puppet-master.psc.local" >> /etc/hosts
Compruebe que tiene conectividad
ping -c 4 puppet-master.psc.local
A continuación instale el Puppet Agent para Debian 11
wget https://apt.puppet.com/puppet-release-bullseye.deb
dpkg -i puppet-release-bullseye.deb
rm puppet-release-bullseye.deb
apt update
apt install -y puppet-agent
source /etc/profile.d/puppet-agent.sh
Ubuntu 22.04
wget https://apt.puppetlabs.com/puppet7-release-jammy.deb
dpkg -i puppet7-release-jammy.deb
apt update
apt install -y puppet-agent
source /etc/profile.d/puppet-agent.sh
Ubuntu 22.04 ARM (Raspberry Pi)
Para instalar Puppet Agent en sistemas ARM como Raspberry Pi, proceda con la siguiente guía:
RedHat Enterprise Linux 8
rpm -Uvh https://yum.puppet.com/puppet7-release-el-8.noarch.rpm
yum update
yum install -y puppet-agent.x86_64
source /etc/profile.d/puppet-agent.sh
RedHat Enterprise Linux 9
rpm -Uvh https://yum.puppet.com/puppet7-release-el-9.noarch.rpm
yum update
yum install -y puppet-agent.x86_64
source /etc/profile.d/puppet-agent.sh
Realice la configuración inicial ejecutando los siguiente comandos
puppet config set runinterval 10m --section main
puppet config set server puppet.psc.local --section agent
puppet config set ca_server puppet.psc.local --section agent
puppet config set environment production --section agent
y podrá ver los cambios en el fichero /etc/puppetlabs/puppet/puppet.conf
. A continuación active el servicio en el arranque e inicie el cliente
systemctl enable puppet
systemctl start puppet
Finalmente genere la petición al servidor y espere a que sea aceptada por el servidor
puppet ssl bootstrap
Mientras la petición es aceptada, desde otra terminal puede comprobar los datos que el agente Puppet recolectará sobre el sistema. Lance el comando para extraer la información en formato Json
facter -j
Podrá ver por consola el siguiente contenido
{
"aio_agent_version": "7.21.0",
"augeas": {
"version": "1.13.0"
},
"disks": {
"sr0": {
"model": "QEMU DVD-ROM",
"serial": "QM00004",
"size": "16.02 MiB",
"size_bytes": 16797696,
"type": "hdd",
"vendor": "QEMU"
},
"xvda": {
"size": "15.00 GiB",
"size_bytes": 16106127360,
"type": "ssd"
},
"xvdb": {
"size": "10.00 MiB",
"size_bytes": 10485760,
"type": "ssd"
}
},
"dmi": {
"bios": {
"release_date": "11/02/2022",
"vendor": "Xen",
"version": "4.13"
},
"chassis": {
"type": "Other"
},
"manufacturer": "Xen",
"product": {
"name": "HVM domU",
"serial_number": "0cf8f762-b654-febd-0cfb-b2dc7b53d67b",
"uuid": "0cf8f762-b654-febd-0cfb-b2dc7b53d67b"
}
},
"facterversion": "4.2.14",
"filesystems": "ext2,ext3,ext4,vfat",
"fips_enabled": false,
"hypervisors": {
"xen": {
"context": "hvm",
"privileged": false
}
},
"identity": {
"gid": 0,
"group": "root",
"privileged": true,
"uid": 0,
"user": "root"
},
"is_virtual": true,
"kernel": "Linux",
"kernelmajversion": "5.10",
"kernelrelease": "5.10.0-20-amd64",
"kernelversion": "5.10.0",
"load_averages": {
"15m": 0.1,
"1m": 0.06,
"5m": 0.16
},
"memory": {
"system": {
"available": "725.45 MiB",
"available_bytes": 760692736,
"capacity": "62.94%",
"total": "1.91 GiB",
"total_bytes": 2052505600,
"used": "1.20 GiB",
"used_bytes": 1291812864
}
},
"mountpoints": {
"/": {
"available": "10.71 GiB",
"available_bytes": 11494977536,
"capacity": "23.24%",
"device": "/dev/xvda1",
"filesystem": "ext4",
"options": [
"rw",
"relatime",
"errors=remount-ro"
],
"size": "14.66 GiB",
"size_bytes": 15743242240,
"used": "3.24 GiB",
"used_bytes": 3480023040
},
"/dev": {
"available": "961.28 MiB",
"available_bytes": 1007976448,
"capacity": "0%",
"device": "udev",
"filesystem": "devtmpfs",
"options": [
"rw",
"nosuid",
"relatime",
"size=984352k",
"nr_inodes=246088",
"mode=755"
],
"size": "961.28 MiB",
"size_bytes": 1007976448,
"used": "0 bytes",
"used_bytes": 0
},
"/dev/hugepages": {
"available": "0 bytes",
"available_bytes": 0,
"capacity": "100%",
"device": "hugetlbfs",
"filesystem": "hugetlbfs",
"options": [
"rw",
"relatime",
"pagesize=2M"
],
"size": "0 bytes",
"size_bytes": 0,
"used": "0 bytes",
"used_bytes": 0
},
"/dev/mqueue": {
"available": "0 bytes",
"available_bytes": 0,
"capacity": "100%",
"device": "mqueue",
"filesystem": "mqueue",
"options": [
"rw",
"nosuid",
"nodev",
"noexec",
"relatime"
],
"size": "0 bytes",
"size_bytes": 0,
"used": "0 bytes",
"used_bytes": 0
},
"/dev/pts": {
"available": "0 bytes",
"available_bytes": 0,
"capacity": "100%",
"device": "devpts",
"filesystem": "devpts",
"options": [
"rw",
"nosuid",
"noexec",
"relatime",
"gid=5",
"mode=620",
"ptmxmode=000"
],
"size": "0 bytes",
"size_bytes": 0,
"used": "0 bytes",
"used_bytes": 0
},
"/dev/shm": {
"available": "978.71 MiB",
"available_bytes": 1026252800,
"capacity": "0%",
"device": "tmpfs",
"filesystem": "tmpfs",
"options": [
"rw",
"nosuid",
"nodev"
],
"size": "978.71 MiB",
"size_bytes": 1026252800,
"used": "0 bytes",
"used_bytes": 0
},
"/run": {
"available": "195.22 MiB",
"available_bytes": 204701696,
"capacity": "0.27%",
"device": "tmpfs",
"filesystem": "tmpfs",
"options": [
"rw",
"nosuid",
"nodev",
"noexec",
"relatime",
"size=200440k",
"mode=755"
],
"size": "195.74 MiB",
"size_bytes": 205250560,
"used": "536.00 KiB",
"used_bytes": 548864
},
"/run/lock": {
"available": "5.00 MiB",
"available_bytes": 5242880,
"capacity": "0%",
"device": "tmpfs",
"filesystem": "tmpfs",
"options": [
"rw",
"nosuid",
"nodev",
"noexec",
"relatime",
"size=5120k"
],
"size": "5.00 MiB",
"size_bytes": 5242880,
"used": "0 bytes",
"used_bytes": 0
},
"/run/user/0": {
"available": "195.74 MiB",
"available_bytes": 205250560,
"capacity": "0%",
"device": "tmpfs",
"filesystem": "tmpfs",
"options": [
"rw",
"nosuid",
"nodev",
"relatime",
"size=200440k",
"nr_inodes=50110",
"mode=700"
],
"size": "195.74 MiB",
"size_bytes": 205250560,
"used": "0 bytes",
"used_bytes": 0
}
},
"networking": {
"dhcp": "192.168.0.1",
"domain": "psc.local",
"fqdn": "puppet.psc.local",
"hostname": "puppet",
"interfaces": {
"eth0": {
"bindings": [
{
"address": "192.168.0.5",
"netmask": "255.255.255.0",
"network": "192.168.0.0"
}
],
"dhcp": "192.168.0.1",
"ip": "192.168.0.5",
"mac": "ea:2d:80:2b:4d:59",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "192.168.0.0"
},
"lo": {
"bindings": [
{
"address": "127.0.0.1",
"netmask": "255.0.0.0",
"network": "127.0.0.0"
}
],
"ip": "127.0.0.1",
"mtu": 65536,
"netmask": "255.0.0.0",
"network": "127.0.0.0"
}
},
"ip": "192.168.0.5",
"mac": "ea:2d:80:2b:4d:59",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "192.168.0.0",
"primary": "eth0"
},
"os": {
"architecture": "amd64",
"distro": {
"codename": "bullseye",
"description": "Debian GNU/Linux 11 (bullseye)",
"id": "Debian",
"release": {
"full": "11.6",
"major": "11",
"minor": "6"
}
},
"family": "Debian",
"hardware": "x86_64",
"name": "Debian",
"release": {
"full": "11.6",
"major": "11",
"minor": "6"
},
"selinux": {
"enabled": false
}
},
"partitions": {
"/dev/xvda1": {
"filesystem": "ext4",
"mount": "/",
"partuuid": "d4c85598-01",
"size": "15.00 GiB",
"size_bytes": 16105061888,
"uuid": "3c0ca9e6-37eb-47fe-93d6-fcc2de2e7b04"
}
},
"path": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin",
"processors": {
"cores": 1,
"count": 1,
"isa": "unknown",
"models": [
"Intel(R) Core(TM) i5-10500T CPU @ 2.30GHz"
],
"physicalcount": 1,
"speed": "2.30 GHz",
"threads": 1
},
"ruby": {
"platform": "x86_64-linux",
"sitedir": "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.7.0",
"version": "2.7.7"
},
"ssh": {
"dsa": {
"fingerprints": {
"sha1": "SSHFP 2 1 bc8cdf331dd6ea4f7084ac0f040a7a6a50f79257",
"sha256": "SSHFP 2 2 aac395271477755067a33fcc533b33ace6886b8bf27e8bcaba07d1f952bef992"
},
"key": "AAAAB3NzaC1kc3MAAACBAN0ebu5Iel551OlHeDO8IUjhEzSEdFsx8AcO4FSOL9DxMAsV1yOPWhnbTXaNvbKcylJBnzGOAFpTcs8+r9pI4D7Qpce/CP2RUW47lowSAmJ1FNkgVeuA4mZrxrO5 nibBDZv69mDdxhQuJD41O0yyH52yvLJMr9PcTbXp7YbffznFAAAAFQC365uBuUEuA97nObiCS5WNAA0apwAAAIEA2nA6KQpMpZrojA7HOwgN+blCbyYRDrr/64KufBn38VshwLUUEp09HZmhqXfIdM8BANSN/6 qaDT6khMeVRB3lOdqoyBouWr/mxT/RbVSDCgljnf5LC/J9SFAbnHfE/lNK5lglypirdpG1LMFHKwNQUt2hpRd9KyK6SIhXBRW+/vwAAACAMuXSLTOIztSiZP9u/7CTCRhJuvmU6Ykjh9p0+U7/K6eJ3Ewp2Gp4 oX44ngDMh4wW9PxM/ofeFqYjSU8qSjmn+tv+l4CNqI5Mh1NLEwi6+L4SNTOBedNUYYXgY+w2cYuJXQA6DYqffvRfxYYI7zQ7e2yxBkjzsDea1ieau9FLhMY=",
"type": "ssh-dss"
},
"ecdsa": {
"fingerprints": {
"sha1": "SSHFP 3 1 eeeaeac00cd234fb0026226b22e6a51a4ac776fc",
"sha256": "SSHFP 3 2 3da88e293f94c86da8d00f34a30585331bea626449fdd0bf889df14b76e3cbd1"
},
"key": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBbOM4RNa/o9fe39TLlb76nLHbyCRDabc2Ec1pGjhuagujlMd85W+RTFfdj4j6k88OkjdruJnp4rSS33fgfYi9k=",
"type": "ecdsa-sha2-nistp256"
},
"ed25519": {
"fingerprints": {
"sha1": "SSHFP 4 1 44160d58bd1f21ba1c7aba39c701c3322dc410ca",
"sha256": "SSHFP 4 2 04e589d1f2c6231a84a90559d2791aea62a93a2356b1442657118c11730d07e4"
},
"key": "AAAAC3NzaC1lZDI1NTE5AAAAIF3OBv/g36opL/2PKf7wGXVzfGJu1LyRnJ3AxhtdMN4b",
"type": "ssh-ed25519"
},
"rsa": {
"fingerprints": {
"sha1": "SSHFP 1 1 901cc45aa50ac9a2c1bf1dfd8b1d6631d94f2dc6",
"sha256": "SSHFP 1 2 74dff355cb60493fb6d47cc838f7e76f2d8298609787a07af563fbe443f49c1c"
},
"key": "AAAAB3NzaC1yc2EAAAADAQABAAABgQDECs2NbjYBXsxfPjRvq2NYMAvblV+3VDYfPRcBY7uvDyoNTH2zCJax3NYcgEy0odzm/wtvNtvKE9eFp1KjEFsZFaUNZgeDlP5l0b/lzHvL/Sw+tImz c9qwUqe+bMLC3bgfF92aLQoe6xfN/FGmMJWRQTydSlebQvqZlBbH9wcma3GyI36ie+DNNUf6yk8x/xV5qIfHSIvYXA9uY9pcF60RcRXBm6pMDkG0BA41DtQToxpNAGjzltRJNyUfPdbWPbTXvNzWG++ZpJlgQL Bhi6mciTSGtw4RC5EDFkTK1ikJ3B43t82m1qVjuW+wQYiKljMycXF3Bq6SYit+EBYtvkKKfQ7bh/XsH0mwdkCmkMI29neqczTESdHCDv1Jarv8tlXcZFISZlmqLo/qrZ5p6L8noNzaam3oSK0hH8vt2mqRrWii pbL4ja9gwLicc0kC0JttYtuF/o2c0xnD0+/v7inlrOrmYjsdfKlQjH4eidgjIwOjxYsEax0jqWSOwgb09fM=",
"type": "ssh-rsa"
}
},
"system_uptime": {
"days": 0,
"hours": 0,
"seconds": 534,
"uptime": "0:08 hours"
},
"timezone": "CET",
"virtual": "xenu"
}