Update multiple Linux servers with apt-dater

I used the following setup:

Controller Server: Ubuntu 14.04
Host Server: Debian 7 Wheezy

Setup the controller

Note: You need a ssh key for your user. If you don’t have one create it with:

ssh-keygen -t rsa 

Install apt-dater:

apt-get install apt-dater 

Now start apt-dater it creates the config files for your user:

$ apt-dater 
** Message: Erstelle Datei /home/sebastian/.config/apt-dater/hosts.conf
** Message: Erstelle Datei /home/sebastian/.config/apt-dater/screenrc
** Message: Erstelle Datei /home/sebastian/.config/apt-dater/apt-dater.conf

Quit apt-dater and install the hosts.

Host installation

Install apt-dater-host:

apt-get install apt-dater-host 

Create apt-dater user:

useradd -r -m apt-dater
mkdir /home/apt-dater/.ssh
chmod 700 /home/apt-dater/.ssh/ && chown apt-dater.apt-dater /home/apt-dater/.ssh
echo "apt-dater ALL=NOPASSWD: /usr/bin/apt-get, /usr/bin/aptitude" >> /etc/sudoers

Upload your ssh-key:

Edit “/home/apt-dater/.ssh/authorized_keys” and insert the content of “~/.ssh/id_rsa.pub” of your controll server.

Note: Use the apt-dater user with multiple ssh-keys to allow other users to use apt-dater.

Add Host to controll server:

Edit “~/.config/apt-dater/hosts.conf” and add the following line:

[TEST]
Hosts=apt-dater@HOSTNAME_OR_IP:22;

Now run apt-dater and patch your host.

apt-dater01

You can add more hosts like this (with different ports):

Hosts=example1.ibh.net;example2.ibh.net;test@example3.ibh.net:62222;

[TEST] ist an example for a group.

Links

* http://irrational.ca/remote-debian-upgrades-using-apt-dater
* http://manpages.ubuntu.com/manpages/karmic/en/man5/apt-dater.conf.5.html
* https://www.bheil.net/Blog/zentralisierte-update-verwaltung-mit-apt-dater

Schreibe einen Kommentar

eMail-Benachrichtigung bei weiteren Kommentaren.
Auch möglich: Abo ohne Kommentar.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.