Revisión 559
Añadido por Francisco Rodrigo hace casi 9 años
tareas_puppet/comunes/ubuntu/ubuntu_pkgsync/leeme.txt | ||
---|---|---|
IMPORTANTE: Se aplica a equipos con el use=ubuntu
|
||
-------------------------------------------------
|
||
|
||
A los que sean necesarios, notebookHP, siatic, infolab, etc...
|
||
|
||
Se discrimina gracias al case del tipo puesto en la tarea.
|
||
|
||
|
||
BREVE DESCRIPCION DE LA EJECUCION DEL MODULO
|
||
--------------------------------------------
|
||
|
||
Primero instala la versión última de pkgsync (actualmente la 0.26) que permite la combinación de varios ficheros dentro de /etc/pkgsync del cliente,
|
||
incluso dentro de subdirectorios para combinarlos en uno solo .all que es el que se ejecuta en el pkgsync.
|
||
|
||
Pone los ficheros /etc/pkgsync/mayhave.d/mayhave.$tipo /etc/pkgsync/musthave.d/musthave.$tipo y /etc/pkgsync/maynothave.d/maynothave.$tipo en el cliente.
|
||
|
||
Donde la extensión tipo nos indica el tipo de máquina (siatic, infolab, notebookHP).
|
||
|
||
Dependiendo de en que equipo se esté aplicando la tarea, se pone las variables mayhave.$tipo, maynothave.$tipo y musthave.$tipo al valor de la ruta y nombre de fichero en cada
|
||
tipo de ordenador. Los ficheros los coge del servidor puppet, de la carpeta correspondiente a la ruta especificada a partir de /etc/puppet/files/xubuntu.
|
||
|
||
Primero creamos los distintos subdirectorios en /etc/puppet/files/xubuntu/:
|
||
|
||
mayhave.d
|
||
musthave.d
|
||
maynothave.d
|
||
|
||
Por lo tanto, antes de pasar la tarea hay que comprobar si existe el fichero en los distintos subdirectorios de /etc/puppet/files/xubuntu/
|
||
|
||
Y si no existe el fichero hay que crearlo e introducir en él los nombres de los paquetes que queremos instalar, que no estén instalados o que puedan estar instalados.
|
||
|
||
Por ejemplo para siatic:
|
||
|
||
/etc/puppet/files/xubuntu/mayhave.d/mayhave.siatic
|
||
/etc/puppet/files/xubuntu/musthave.d/musthave.siatic
|
||
/etc/puppet/files/xubuntu/maynothave.d/maynothave.siatic
|
||
|
||
Así con el resto de tipos (infolab y notebookHP de momento)
|
||
|
||
Ficheros de la tarea (dentro del directorio servidor:/etc/puppet/modules/ubuntu_pkgsync/):
|
||
----------------------------------------------------------------------------------------
|
||
|
||
files/ -> pkgsync_1.26_all.deb
|
||
|
||
leeme.txt
|
||
|
||
manifests/ -> init.pp: la tarea propiamente dicha
|
||
|
||
|
||
|
||
INSTRUCCIONES DE INSTALACION DEL MODULO
|
||
---------------------------------------
|
||
|
||
Desempaquetar en /etc/puppet/modules
|
||
|
||
Creado por:
|
||
Jose Miguel Medina
|
||
IES Matías Ramón Martínez (Burguillos del Cerro)
|
||
Octubre-2014
|
||
|
||
Modificado por:
|
||
Francisco Rodrigo López
|
||
IES Javier García Téllez (Cáceres)
|
||
Mayo-2016
|
tareas_puppet/comunes/ubuntu/ubuntu_pkgsync/manifests/init.pp | ||
---|---|---|
#Clase para control de los ficheros básicos para pkgsync de siatic, infolab y notebookHP
|
||
|
||
|
||
class ubuntu_pkgsync {
|
||
|
||
|
||
file { "/root/pkgsync_all.deb":
|
||
owner => root, group => root, mode => 755,
|
||
source => "puppet:///modules/ubuntu_pkgsync/pkgsync_1.26_all.deb",
|
||
notify => Exec ["instala-pkgsync"],
|
||
}
|
||
|
||
exec {"instala-pkgsync":
|
||
command => "dpkg -i /root/pkgsync_all.deb",
|
||
subscribe => File["/root/pkgsync_all.deb"],
|
||
unless => "dpkg -l | grep pkgsync | grep 1.26 | grep ii",
|
||
}
|
||
|
||
|
||
case $tipo {
|
||
|
||
"siatic": {
|
||
file { "mayhave.instituto":
|
||
path => "/etc/pkgsync/mayhave.d/mayhave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/mayhave.d/mayhave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "maynothave.instituto":
|
||
path => "/etc/pkgsync/maynothave.d/maynothave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/maynothave.d/maynothave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "musthave.instituto":
|
||
path => "/etc/pkgsync/musthave.d/musthave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/musthave.d/musthave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
|
||
}
|
||
"infolab": {
|
||
file { "mayhave.instituto":
|
||
path => "/etc/pkgsync/mayhave.d/mayhave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/mayhave.d/mayhave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "maynothave.instituto":
|
||
path => "/etc/pkgsync/maynothave.d/maynothave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/maynothave.d/maynothave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "musthave.instituto":
|
||
path => "/etc/pkgsync/musthave.d/musthave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/musthave.d/musthave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
}
|
||
"notebookHP": {
|
||
file { "mayhave.instituto":
|
||
path => "/etc/pkgsync/mayhave.d/mayhave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/mayhave.d/mayhave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "maynothave.instituto":
|
||
path => "/etc/pkgsync/maynothave.d/maynothave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/maynothave.d/maynothave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
file { "musthave.instituto":
|
||
path => "/etc/pkgsync/musthave.d/musthave.$tipo",
|
||
owner => root, group => root, mode => 644,
|
||
source => "puppet:///files/xubuntu/musthave.d/musthave.$tipo",
|
||
ensure => file,
|
||
}
|
||
|
||
}
|
||
|
||
default: { }
|
||
|
||
}
|
||
|
||
|
||
# Por si no existen los ficheros, los creamos inicialmente a vacíos
|
||
file { "mayhave.inicial":
|
||
path => "/etc/pkgsync/mayhave",
|
||
owner => root, group => root, mode => 644,
|
||
ensure => file,
|
||
}
|
||
|
||
file { "maynothave.inicial":
|
||
path => "/etc/pkgsync/maynothave",
|
||
owner => root, group => root, mode => 644,
|
||
ensure => file,
|
||
}
|
||
|
||
}
|
||
Exportar a: Unified diff
Tarea para instalar ultima version pkgsync y su posterior control de ficheros mayhave,musthave y maynothave