Project

General

Profile

Demande #1080

ajout des backups harmine sur puppet

Added by Loïc Dachary about 11 years ago. Updated over 4 years ago.

Status:
Fermé
Priority:
Immédiate
Assignee:
Category:
Task
Target version:
Start date:
12/06/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Difficulté:
2 Facile

Description

ajouter ce qu'il faut dans source:puppetmaster pour qu'un host s'enregistre aupres de backuppc lorsqu'il est créé
backuppc


Files

backuppc.png (8.36 KB) backuppc.png backuppc Loïc Dachary, 12/10/2012 04:15 PM

Associated revisions

Revision 235baca3 (diff)
Added by Loïc Dachary about 11 years ago

implémentation initiale dans l'idée d'ajouter, pour domain.com une ligne dans le fichier /etc/backuppc/hosts, un fichier domain.com.pl sur le serveur backuppc et un utilisateur sudo sur la machine cliente qui autorise le serveur a venir faire le backup refs #1080

Revision 9574495b (diff)
Added by Loïc Dachary about 11 years ago

définition de harmine et backuppc : un serveur backuppc et nrpe
ajout du plugin nrpe sur la definition du server nagios
la classe backuppc::puppetmaster fabrique une clé pour les backups
backuppc::client utilise un script rsync_sender pour que le sudo ait seulement un accès root readonly pour éviter les accidents
refs #1080

Revision 5f05d2d3 (diff)
Added by Loïc Dachary about 11 years ago

the backuppc server asks to be monitored using the standard check_backuppc plugin via nrpe refs #1080

Revision e5ead50f (diff)
Added by Loïc Dachary about 11 years ago

the service name is backuppc, not zfs refs #1080

Revision 1c6af9d6 (diff)
Added by Loïc Dachary about 11 years ago

add a require file to ensure the file for the nagios exported resources is created first refs #1080

Revision 2d11c244 (diff)
Added by Loïc Dachary about 11 years ago

ajout de la dépendance du service avec le package nagios3 refs #1080

Revision 612536d6 (diff)
Added by Loïc Dachary about 11 years ago

apt-get install -y rubygems pour préparer le puppetmaster refs #1080

Revision 00643287 (diff)
Added by Loïc Dachary about 11 years ago

augmente la verbosité de l'installation des gems sur le puppetmaster refs #1080

Revision 367f2de1 (diff)
Added by Loïc Dachary about 11 years ago

desactive les tests autre que backuppc refs #1080

Revision 60dbf86d (diff)
Added by Loïc Dachary about 11 years ago

installation de nagios-nrpe-plugin sur nagios server au lieu du serveur refs #1080

Revision 1f419f75 (diff)
Added by Loïc Dachary about 11 years ago

generation de la clé ssh destinée au backup sur le puppet master refs #1080

Revision a6218ccc (diff)
Added by Loïc Dachary about 11 years ago

la clé destinée aux backup doit appartenir a l'utilisateur puppet refs #1080

Revision f8a253b4 (diff)
Added by Loïc Dachary about 11 years ago

la clé destinée aux backup être générée sur le puppet master qui est lui meme un client puppet refs #1080

Revision 9bc037a0 (diff)
Added by Loïc Dachary about 11 years ago

s/pupet/puppet/ refs #1080

Revision a3531e71 (diff)
Added by Loïc Dachary about 11 years ago

puppet agent exit code does not reflect failure or success refs #1080

Revision 054f61e1 (diff)
Added by Loïc Dachary about 11 years ago

change before en require pour s'assurer que le répertoire existe refs #1080

Revision 53cfedec (diff)
Added by Loïc Dachary about 11 years ago

nagios est backup refs #1080

Revision c6c39468 (diff)
Added by Loïc Dachary about 11 years ago

nagios-nrpe-server doit etre restart lorsque la commande check_backuppc est ajoutée sinon il n'en tient pas compte.
la definition de la commande nrpe check_backuppc est mise directement dans le manifest au lieu d'être dans un fichier séparé
refs #1080

Revision e211f715 (diff)
Added by Loïc Dachary about 11 years ago

ajout du service backuppc qui avait été oublié refs #1080

Revision 539ca9f6 (diff)
Added by Loïc Dachary about 11 years ago

documentation des tests
lancement des tests unitaires avant les tests d'integration
refs #1080

Revision a40cdf91 (diff)
Added by Loïc Dachary about 11 years ago

run puppet on backuppc before starting full backup. Why is it not already defined ?
su to backuppc before starting the full backup
refs #1080

Revision 54d80ef5 (diff)
Added by Loïc Dachary about 11 years ago

fix misleading comment
refs #1080

Revision ede05e7d (diff)
Added by Loïc Dachary about 11 years ago

installation de nagios-plugins-contrib parceque ce n'est pas fait par défaut dans squeeze et que c'est ce package qui contient check_backuppc
refs #1080

History

#1

Updated by Loïc Dachary about 11 years ago

sp4rky utilise un dérivé de https://github.com/DavidS/puppet-backuppc/blob/master/manifests/init.pp
rodo utilise un module custom

#3

Updated by Loïc Dachary about 11 years ago

(10:50:04 AM) dachary: je me demandais si tu pouvais me raconter l'histoire de  /usr/local/bin/validate-sudo ou si tu ne sais pas ce que c'est ;-)
(10:50:06 AM) raceme: dachary: le validate-sudo c'est du rv2 en fait, perso je fais en root :)
(10:50:42 AM) dachary: je ne vais pas summon rv2
(10:50:58 AM) raceme: dachary: je crois que c'est pour ne pas faire du ssh en root et passer le rsync à travers du sudo... Enfin à partir du moment où le compte peut faire sudo et écrire n'importe où en root je ne vois pas trop l'intérêt
#5

Updated by Loïc Dachary about 11 years ago

http://exchange.nagios.org/directory/Plugins/Backup-and-Recovery/BackupPC/check_backuppc_shares/details
est plus moderne mais traite de cas plus complexes ( subshares ) et n'a pas de tests associés

#6

Updated by Loïc Dachary about 11 years ago

what about using check-mk instead of nrpe to run the backuppc nagios plugin
https://github.com/jthornhill/puppet-checkmk/tree/master/manifests

#7

Updated by Loïc Dachary about 11 years ago

root@nagios:~# dpkg -S /usr/lib/nagios/plugins/check_backuppc
nagios-plugins-contrib: /usr/lib/nagios/plugins/check_backuppc

#8

Updated by Loïc Dachary about 11 years ago

root@harmine:/etc# puppet agent -vt --fqdn harmine.pavot.vm.april-int
info: Retrieving plugin
info: Loading facts in puppet_vardir
info: Loading facts in concat_basedir
info: Loading facts in pe_version
info: Loading facts in root_home
info: Loading facts in puppet_vardir
info: Loading facts in concat_basedir
info: Loading facts in pe_version
info: Loading facts in root_home
info: Caching catalog for harmine.pavot.vm.april-int
info: Applying configuration version '1355148767'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Package[nagios-nrpe-server]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/File[/etc/nagios/nrpe.d/backuppc.cfg]/ensure: created
info: /Stage[main]//Node[harmine.pavot.vm.april-int]/File[/etc/nagios/nrpe.d/backuppc.cfg]: Scheduling refresh of Service[nagios-nrpe-server]
notice: /Stage[main]/Backuppc::Server/File[/var/lib/backuppc/.ssh/abackup]/ensure: defined content as '{md5}007548ad56ddaea2dbc410bccfcdfad5'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Service[nagios-nrpe-server]/ensure: ensure changed 'stopped' to 'running'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Service[nagios-nrpe-server]: Triggered 'refresh' from 1 events
notice: /Stage[main]/Backuppc::Server/File_line[backuppc_host_nagios.vm.april-int]/ensure: created
info: /Stage[main]/Backuppc::Server/File_line[backuppc_host_nagios.vm.april-int]: Scheduling refresh of Service[backuppc]
notice: /Stage[main]/Backuppc::Server/Service[backuppc]: Triggered 'refresh' from 1 events
--- /etc/vim/vimrc.local    2012-12-04 02:08:55.000000000 +0100
+++ /tmp/puppet-file20121210-14168-8to8np-0    2012-12-10 15:28:19.853038848 +0100
@@ -1,6 +1,6 @@
 " 
 " DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN
-" GENERATED FROM puppet.vm.april-int:/etc/puppet/files/vimrc.local
+" GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/vim/files/vimrc.local
 " 
 syntax on
 set paste
info: FileBucket adding /etc/vim/vimrc.local as {md5}adcc712e1cbd3a9a11fec7105ba3783c
info: /Stage[main]/Vim/File[/etc/vim/vimrc.local]: Filebucketed /etc/vim/vimrc.local to puppet with sum adcc712e1cbd3a9a11fec7105ba3783c
notice: /Stage[main]/Vim/File[/etc/vim/vimrc.local]/content: content changed '{md5}adcc712e1cbd3a9a11fec7105ba3783c' to '{md5}2e31556d175342cc9633b30a8737297c'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Package[sudo]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/File_line[sudo_backuppc]/ensure: created
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: executed successfully
notice: /Stage[main]/Backuppc::Server/File[config_file_nagios.vm.april-int]/ensure: created
--- /root/.bashrc    2012-12-04 02:09:07.000000000 +0100
+++ /tmp/puppet-file20121210-14168-uy6v9m-0    2012-12-10 15:28:27.388539245 +0100
@@ -1,6 +1,6 @@
 #
 # DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN
-# GENERATED FROM puppet.vm.april-int:/etc/puppet/files/.bashrc
+# GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/bash/files/.bashrc
 #
 export HISTCONTROL=ignoredups # Ne pas conserver plusieurs fois de suite la même commande dans l'historique.
 if [ -f /etc/bash_completion ]; then
@@ -13,3 +13,10 @@
 fi
 export HISTSIZE=500000
 export PROMPT_COMMAND='history -a'
+
+alias dpkg-source="dpkg -l | awk '/^.i/ {print \$2}' | xargs apt-cache policy | awk '/^[a-z0-9\-]+:/ {pkg=\$1}; /\*\*\*/ {OFS=\"\t\"; ver=\$2; getline; print pkg,ver,\$2,\$3}'" 
+#
+# For vserver hosts
+#
+alias upgrade_all='vapt-get --all -- update ; vapt-get --all upgrade && vapt-get --all dist-upgrade; vapt-get --all clean; apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get clean'
+alias run_all='vsomething vserver --running --all -- exec '
info: FileBucket adding /root/.bashrc as {md5}8e6fea1fb8950ebfdf798e1186b4aec7
info: /Stage[main]/Bash/File[/root/.bashrc]: Filebucketed /root/.bashrc to puppet with sum 8e6fea1fb8950ebfdf798e1186b4aec7
notice: /Stage[main]/Bash/File[/root/.bashrc]/content: content changed '{md5}8e6fea1fb8950ebfdf798e1186b4aec7' to '{md5}e22880457ebb6d9ac06331f5c763adf9'
--- /root/.screenrc    2012-12-04 02:09:05.000000000 +0100
+++ /tmp/puppet-file20121210-14168-1owi1j-0    2012-12-10 15:28:27.732041273 +0100
@@ -1,9 +1,8 @@
 #
 # DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN
-# GENERATED FROM puppet.vm.april-int:/etc/puppet/files/.screenrc
+# GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/screen/files/.screenrc
 #
 escape ^^^[
 hardstatus on
 hardstatus alwayslastline
 hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " 
-
info: FileBucket adding /root/.screenrc as {md5}bc8a0cb710ba8ba34057e0cba5ffc05f
info: /Stage[main]/Screen/File[/root/.screenrc]: Filebucketed /root/.screenrc to puppet with sum bc8a0cb710ba8ba34057e0cba5ffc05f
notice: /Stage[main]/Screen/File[/root/.screenrc]/content: content changed '{md5}bc8a0cb710ba8ba34057e0cba5ffc05f' to '{md5}161e395e35e791ea2ebf041f4764a8fb'
notice: Finished catalog run in 26.28 seconds
#9

Updated by Loïc Dachary about 11 years ago

sur harmine il faut prendre augeas-tools de backports

apt-get install augeas-tools=0.10.0-1~bpo60+3 libaugeas0=0.10.0-1~bpo60+3 augeas-lenses=0.10.0-1~bpo60+3

sinon il n'y a pas la lens qui va bien pour nrpe.cfg

#11

Updated by Loïc Dachary about 11 years ago

  • Status changed from En cours de traitement to Résolu
  • % Done changed from 0 to 100
#12

Updated by Loïc Dachary almost 11 years ago

  • Subject changed from ajout des backups sur puppet to ajout des backups harmine sur puppet
#13

Updated by Quentin Gibeaux over 4 years ago

  • Status changed from Résolu to Fermé

Also available in: Atom PDF