Revisión 447
Añadido por Esteban M. Navas Martín hace más de 12 años
tareas_puppet/servidores_aula/squeeze/ltsp_squid/LEEME | ||
---|---|---|
Francisco Rodrigo López
|
||
Administrador informático del IES Javier García Téllez.
|
||
14-Noviembre-2012
|
||
|
||
Esteban M. Navas Martín
|
||
Administrador informático del IES Valle del Jerte.
|
||
12-Diciembre-2012
|
||
|
||
# Revisado: Esteban M. Navas Martín
|
||
# Fecha: 12/12/2012
|
||
# Corregido bug en script proxys_intermedios.sh para que busque el comienzo del nombre del servidor LTSP y
|
||
evitar que falle cuando el nombre de un equipo sea parte del de otro.
|
||
Se producía un error cuando había equipos con nombres: a01-pro dlengua01-pro, a02-pro dmatematicas02-pro...
|
||
# Modificada la tarea para que se reinicie squid cuando se modifiquen los archivos /etc/squid/squid.conf",
|
||
"/etc/squid/squid-cache.conf","/etc/squid/squid-cache-refresh.conf","/etc/squid/proxys_intermedios.sh"
|
||
|
tareas_puppet/servidores_aula/squeeze/ltsp_squid/manifests/init.pp | ||
---|---|---|
|
||
exec { "configurar-squid":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "update-rc.d -f squid remove; insserv squid",
|
||
command => "update-rc.d -f squid remove && insserv squid",
|
||
require => File["/etc/init.d/squid"],
|
||
unless => "ls /etc/rc2.d/S01squid",
|
||
unless => "test -L /etc/rc2.d/S??squid",
|
||
}
|
||
|
||
exec { "denegar-https":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "update-rc.d -f deny_https_iptables remove; insserv deny_https_iptables",
|
||
command => "update-rc.d -f deny_https_iptables remove && insserv deny_https_iptables",
|
||
require => File["/etc/network/iptables","/etc/init.d/deny_https_iptables"],
|
||
unless => "ls /etc/rc2.d/S19deny_https_iptables",
|
||
unless => "test -L /etc/rc2.d/S??deny_https_iptables",
|
||
}
|
||
|
||
exec { "configurar-proxy":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "update-rc.d -f enable-local-proxy remove; insserv enable-local-proxy",
|
||
command => "update-rc.d -f enable-local-proxy remove && insserv enable-local-proxy",
|
||
require => File["/etc/init.d/enable-local-proxy"],
|
||
unless => "ls /etc/rc2.d/S23enable-local-proxy",
|
||
unless => "test -L /etc/rc2.d/S??enable-local-proxy",
|
||
}
|
||
|
||
exec { "configurar-nat":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "update-rc.d -f enable-nat remove; insserv enable-nat",
|
||
command => "update-rc.d -f enable-nat remove && insserv enable-nat",
|
||
require => File["/etc/init.d/enable-nat"],
|
||
unless => "ls /etc/rc2.d/S25enable-nat",
|
||
unless => "test -L /etc/rc2.d/S??enable-nat",
|
||
}
|
||
|
||
exec { "instalar-sarg-squid-apache2":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "apt-get update; dpkg --configure -a; apt-get -yf --force-yes install squid sarg apache2",
|
||
command => "apt-get update && dpkg --configure -a && apt-get -yf --force-yes install squid sarg apache2",
|
||
require => File["/etc/apt/sources.list.d/backports.list"],
|
||
unless => "test `dpkg -l | egrep 'apache2 | squid | sarg' | grep ii | wc -l` -eq 3",
|
||
}
|
||
... | ... | |
command => "/etc/squid/proxys_intermedios.sh",
|
||
require => [ Exec["instalar-sarg-squid-apache2"], File["/etc/squid/proxys_intermedios.sh"] ],
|
||
before => Exec["reiniciar-squid"],
|
||
unless => "ls /etc/squid/proxys_intermedios.conf",
|
||
creates => "/etc/squid/proxys_intermedios.conf",
|
||
}
|
||
|
||
exec { "reiniciar-cron":
|
||
... | ... | |
|
||
exec { "reiniciar-squid":
|
||
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||
command => "/etc/init.d/squid restart;/etc/init.d/deny_https_iptables restart;/etc/init.d/enable-local-proxy restart;/etc/init.d/enable-nat restart",
|
||
command => "/etc/init.d/squid restart && /etc/init.d/deny_https_iptables restart && /etc/init.d/enable-local-proxy restart && /etc/init.d/enable-nat restart",
|
||
require => File["/etc/squid/squid.conf","/etc/squid/squid-cache.conf","/etc/squid/squid-cache-refresh.conf"],
|
||
subscribe => File["/etc/squid/squid.conf","/etc/squid/squid-cache.conf","/etc/squid/squid-cache-refresh.conf","/etc/squid/proxys_intermedios.sh"],
|
||
refreshonly => true,
|
||
}
|
||
|
tareas_puppet/servidores_aula/squeeze/ltsp_squid/files/proxys_intermedios.sh | ||
---|---|---|
# Copyright (c) 2010 - Antonio J. Abasolo Sierra
|
||
# Fecha: Abril-2010. Ultima rev.: Abril-2010
|
||
#----------------------------------------------------------
|
||
|
||
#
|
||
# Revisado: Esteban M. Navas Martín
|
||
# Fecha: 12/12/2012
|
||
# Corregido bug poara que busque el comienzo del nombre del servidor LTSP:
|
||
# ipLTSP=`grep ^$LTSP /tmp/ListaPcs | cut -f2 -d,`
|
||
# Evitamos que el script falle cuando el nombre de un equipo sea parte del de otro.
|
||
# Se producíaun error cuando hab?a equipos con nombres: a01-pro dlengua01-pro, a02-pro dmatematicas02-pro...
|
||
#
|
||
# VARIABLES --------------------------------------------------------------------------------
|
||
DN="dc=instituto,dc=extremadura,dc=es"
|
||
BASESEARCH=" -xLLL -h ldap -b "
|
||
... | ... | |
|
||
ldapsearch $BASESEARCH ou=Netgroup,$DN "(cn=ltsp-server-hosts)" | grep nisNetgroupTriple | cut -f2 -d'(' | cut -f1 -d',' > /tmp/ListaLTSP
|
||
grep -vw `hostname|cut -f1 -d.` /tmp/ListaLTSP | sort | while read LTSP ; do
|
||
ipLTSP=`grep $LTSP /tmp/ListaPcs | cut -f2 -d,`
|
||
ipLTSP=`grep ^$LTSP /tmp/ListaPcs | cut -f2 -d,`
|
||
echo "#Servidor de Aula: $LTSP" >> $FICHERO
|
||
echo "cache_peer $ipLTSP sibling 80 3130 proxy-only" >> $FICHERO
|
||
done
|
tareas_puppet/servidores_aula/squeeze/ltsp_squid/files/backports.list | ||
---|---|---|
deb http://backports.debian.org/debian-backports squeeze-backports main
|
||
deb http://ldap/debian-backports squeeze-backports main
|
Exportar a: Unified diff
Corregido bug en script de configuración de proxys intermedios de ltsp_squid y modificada tarea para reiniciar squid al modificar archivos