sudo apt-get install -y puppetmaster
sudo apt-get install -y puppet
/etc/puppet/puppet.conf
: [agent] server = mysuperserver node_name = cert certname = nameofworkstation
mysuperserver
must be replaced with the domain name of your server, and nameofworkstation
with the name that you decided to assign to this particular client. If your organization does not have DNS configured, you can add a server to /etc/hosts
for each client. It is important! The SSL certificate that Puppet uses in the future is generated for the domain name of the server. If you specify IP in the configuration, you will get a failure at further stages. puppet agent --test
puppet cert sign nameofworkstation
nameofworkstation
will be the name that you have prescribed for the client earlier when performing the 3rd item. A list of all currently requested certificate issuance by the server can be viewed with the command puppet cert --list
. puppet agent --enable puppet agent --test
#!/bin/bash echo ============================================= echo puppet echo ============================================= apt-get install -y puppetmaster echo ============================================= COMMAND=nope while [ "$COMMAND" != "end" ] do echo ============================================= echo client.sh . , [ENTER] , . Ctrl+C, . echo ============================================= COMMAND=`read` echo ============================================= echo echo ============================================= puppet cert sign --all done
#!/bin/bash # 2 MASTER_IP=192.168.0.100 SERVER_NAME=server echo ============================================= echo ID echo ============================================= sudo apt-get install -y uuid ID=`uuid` echo ============================================= echo $SERVER_NAME $MASTER_IP echo ============================================= echo $MASTER_IP $SERVER_NAME >> /etc/hosts echo ============================================= echo puppet echo ============================================= sudo apt-get install -y puppet echo ============================================= echo puppet echo ============================================= sudo cat >> /etc/puppet/puppet.conf << EOF [agent] server = $SERVER_NAME node_name = cert certname = workstation-$ID EOF echo ============================================= echo echo ============================================= puppet agent --test echo ============================================= echo [ENTER], . echo ============================================= read -n 1 echo ============================================= echo echo ============================================= puppet agent --enable puppet agent --test echo ============================================= echo echo =============================================
client.sh
to match your environment: the IP address of the server (you must make it static) and the name of the server (this should be the computer name that you set when you installed Ubuntu). These are the first 2 variables at the beginning of the file, you need to fix them.server.sh
starts on the server, then server.sh
on each of the clients. After that, on the server, press Enter to allow the server to sign all client certificates./etc/x11vnc.pass
file with the following command (everything is done on the server): sudo x11vnc -storepasswd 1 /etc/x11vnc.pass
/etc/puppet/manifests/
site.pp
file site.pp
following content: package { "mc": ensure => installed, } package { "x11vnc": ensure => installed, } file { "/etc/x11vnc.pass": content => file("/etc/x11vnc.pass"), mode => 600, } $str = "start on login-session-start script /usr/bin/x11vnc -xkb -forever -auth /var/run/lightdm/root/:0 -display :0 -rfbauth /etc/x11vnc.pass -rfbport 5900 -bg -o /var/log/x11vnc.log end script " file { "/etc/init/x11vnc.conf": content => "$str", mode => 644, }
mc
and x11vnc
, and creates a service that automatically starts VNC with the specified password when the login screen appears. (I used this answer in the configuration) Please note that choosing the name /etc/puppet/manifests/site.pp
not my whim. This is the way in which Puppet stores the default manifest. Again, I am glad of any constructive criticism of my self-made manifesto (I love Habr for constructive criticism).Source: https://habr.com/ru/post/265755/
All Articles