03/11/2020
Ph. Sevre
D'après Larry Wall, éminent créateur du langage Perl, les 3 vertus cardinales du développeur et/ou de l'administrateur système sont :
Nov 18 16:11:43 pitou smbd_vscan-clamav[9456]: [2008/11/18 16:09:37, 0] smbd/service.c:make_connection(1102) Nov 18 16:11:43 pitou smbd_vscan-clamav[9456]: pccdi-00 (172.16.110.191) couldn't find service rentree2005 Nov 18 16:11:44 marge dhcpd: DHCPREQUEST for 172.16.110.157 from 00:1c:c4:66:de:e9 (PT245-11) via 172.16.110.254 Nov 18 16:11:44 marge dhcpd: DHCPACK on 172.16.110.157 to 00:1c:c4:66:de:e9 (PT245-11) via 172.16.110.254 Nov 18 16:11:52 marge dhcpd: ip length 312 disagrees with bytes received 392. Nov 18 16:11:52 marge dhcpd: accepting packet with data after udp payload. Nov 18 16:11:52 marge dhcpd: DHCPDISCOVER from 00:1e:c1:06:78:60 via eth0: network 172.16.0.2/32: no free leases Nov 18 16:11:54 marge postfix/smtpd[22391]: connect from zenoss.lecastel.lan[172.16.0.9]
git commit -a -c "Chgt DNS"
git show log
sudo vmbuilder kvm ubuntu --arch i386 --ip 192.168.0.100 --part vmbuilder.partition --user user --name user --pass = default --tmpfs - --firstboot boot.sh --firstlogin login.sh --mirror http://mirroraddress:9999/ubuntu --suite intrepid --flavour virtual --addpkg apache2 --addpkg apache2-mpm-prefork --addpkg apache2-utils --addpkg apache2.2-common
for server in "pim pam poum" do ssh $server "aptitude update && aptitude upgrade -y" done
dsh -g lesserveurs "aptitude update && aptitude upgrade -y"
Le paysage vu d'un peu plus près est loin d'être idyllique, selon les distributions, les outils diffèrent :
Les noms de paquetages également :
Comme les répertoires de base :
Puppet permet de décrire :
class resolv { file { "/etc/resolv.conf": owner => root, group => root, mode => 644, source => [ "puppet://puppet/files/$hostname/resolv.conf", "puppet://puppet/files/etc/resolv.conf"] } }
class ntp { # On installe le paquetage si besoin package { ntp: ensure => installed, } # Le fichier de configuration file { "/etc/ntp.conf": source => "puppet://puppet/files/etc/ntp.conf", # On declenche ce controle "file" apres l'install du package require => Package[ntp] } # On declare aussi le service ntp qui sera démarré et contrôlé service { ntp: ensure => running, # Si le package ou le fichier de conf sont modifiés, on redémarre le service. subscribe => [Package[ntp], File["/etc/ntp.conf"]] } }
node generic-etch { #debian Etch generique include sudo, snmp-etch, ntp, timezone, etch-default-install, apt-etch, resolv } node webserver inherits generic-etch { include apache, php5 } node mailserver inherits generic-etch { include postfix } node "ld.heberge.info" inherits webserver { $hostkind="alternc"; } node "webpublic.heberge.info" inherits webserver, mailserver { include webpublic_resolv }
<Location "/cgi-bin/<%= name %>.cgi"> SetEnv TRAC_ENV "/export/svn/trac/<%= name %>" </Location> # You need something like this to authenticate users <Location "/cgi-bin/<%= name %>.cgi/login"> AuthType Basic AuthName "Trac" AuthUserFile /etc/apache2/auth/svn Require valid-user </Location>
architecture => i386 domain => lecastel.lan fqdn => kid.lecastel.lan hostname => kid ipaddress => 172.16.0.34 kernel => Linux kernelrelease => 2.6.27-7-generic lsbdistcodename => intrepid lsbdistdescription => Ubuntu 8.10 macaddress => 00:15:f2:1f:92:5e
Puppet n'est pas :
exemple : installation d'apache2 + php5 sur une Linux Debian
# playbook.yml --- - hosts: all tasks: - name: 1. install Apache apt: name=apache2 state=present - name: 2. install PHP module for Apache apt: name=libapache2-mod-php5 state=present - name: 3. start Apache service: name=apache2 state=running enabled=yes - name: 4. install Hello World PHP script copy: src=index.php dest=/var/www/index.php mode=0664
cf http://kangaroot.net/easy-server-configuration-management