source: trunk/puppet/modules/puppet-escritorio/manifests/classes/gnome.pp @ 727

Last change on this file since 727 was 721, checked in by sebas@…, 14 years ago

formateo + notify para ejecutar el comando

File size: 5.5 KB
Line 
1# copyright <sebas @ koumbit.org>
2# copyright <josx @ interorganic.com.ar >
3# Licence: GPL
4#
5
6class escritorio::gnome-theme::xp {
7    $local_path = "/dist/svn-redcta"
8    $local_name = "gnome-theme-xp"
9    $jaunty_script = "change-default-to-xp.sh"
10    $lucid_script = "lucid-escritorio-xp.sh"
11    $jaunty_file_path = "$local_path/$local_name/$jaunty_script"
12    $lucid_file_path =  "$local_path/$local_name/$lucid_script"
13
14    case $operatingsystem {
15        Ubuntu: {
16            case $lsbdistcodename {
17                Jaunty: {
18                    $ejecuta = $jaunty_file_path
19                }
20                Lucid: {
21                    $ejecuta = $lucid_file_path
22                }
23                default: {
24                    err("No hay tema para $operatingsystem - $lsbdistcodename")
25                }   
26            }
27        }
28    }
29   
30    svn::checkout { gnome-theme-xp:
31        repository => "https://svn.redcta.org.ar/proyectos/redcta/trunk/gnome-theme-xp",
32        local_path => $local_path,
33        local_name => $local_name,
34        notify     => [ Exec["$ejecuta"] ],
35        before     => [ File["$ejecuta"] , Exec["$ejecuta"] ],
36    }
37
38    file { "/dist/svn-redcta/gnome-theme-xp/change-default-to-xp.sh":
39        ensure => "present",
40        owner  => "root", group => "root", mode => "755", checksum => mtime,
41    }
42
43    file { "$lucid_file_path":
44        ensure => "present",
45        owner  => "root", group => "root", mode => "755", checksum => mtime,
46    }
47
48    #   Esto no deberia hacerse, solamente habria usar ejecutar, lo dejo por jaunty
49    #   ver changeset [643]
50    #   falta poner refresh = true en lucid
51    case $operatingsystem {
52        Ubuntu: {
53            case $lsbdistcodename {
54                Jaunty: {
55                    exec { "$jaunty_file_path":
56                    refreshonly => true,
57                    subscribe => File["/dist/svn-redcta/gnome-theme-xp/change-default-to-xp.sh"]
58                    }
59                }
60                Lucid: {
61                    exec { "$lucid_file_path":
62                    refreshonly => true,
63                    subscribe => File["$lucid_file_path"]
64                    }
65                }
66                default: {
67                    err("No hay tema para $operatingsystem - $lsbdistcodename")
68                }   
69            }
70        }
71        default: {
72            err("No hay tema para $operatingsystem")
73        }   
74    }
75}
76
77
78class escritorio::iconos {
79
80    package { [ "xdg-utils" ]: ensure => installed }
81   
82    # Modificamos el archivo xdg-desktop-icon porque solo funcionaba para el directorio Desktop     
83    file { "/usr/bin/xdg-desktop-icon":
84        owner   => root,
85        group   => root,
86        mode    => 755,
87        source  => "puppet:///escritorio/xdg/xdg-desktop-icon",
88        require => Package["xdg-utils"]
89    }
90
91    file  { "/etc/X11/Xsession.d/65xdg-user-desktop-icons-update":
92        ensure => "/dist/svn-redcta/gnome-theme-xp/Xsession.d/65xdg-user-desktop-icons-update"
93    }
94
95}
96
97
98class escritorio::fondos::cta {
99
100    svn::checkout { escritorio-fondos-cta:
101        repository => "https://svn.redcta.org.ar/proyectos/redcta/trunk/escritorio-fondos-cta",
102        local_path => "/dist/svn-redcta",
103        local_name => "escritorio-fondos-cta"
104    }
105
106    file  { "/usr/share/backgrounds/wpiedras-hojitas.jpg":
107        ensure => "/dist/svn-redcta/escritorio-fondos-cta/wpiedras-hojitas.jpg"
108    }
109
110    file { "/usr/share/backgrounds/wpiedras-verdecito.jpg":
111        ensure => "/dist/svn-redcta/escritorio-fondos-cta/wpiedras-verdecito.jpg"
112    }
113}
114
115
116class escritorio::autostart-off {
117
118    define deshabilita_servicios($archivos) {
119        deshabilita_servicio { $archivos: archivo => $name }
120    }
121
122    define deshabilita_servicio($archivo) {
123        file { "${archivo}/$name"  : ensure => present, }
124
125        line { "verdadero$name" :
126            file   => "${archivo}/$name",
127            line   => "X-GNOME-Autostart-enabled=true",
128            ensure => absent,
129        }
130        line { "falso$name":
131            file   => "${archivo}/$name" ,
132            line   => "X-GNOME-Autostart-enabled=false",
133            ensure => present,
134        }
135    }
136
137    case $operatingsystem {
138    Ubuntu: {
139        case $lsbdistcodename {
140            Jaunty: {
141                deshabilita_servicios { "/etc/xdg/autostart":
142                    archivos => [ "vino-server.desktop", "update-notifier.desktop", "bluetooth-applet.desktop", "evolution-alarm-notify.desktop", "jockey-gtk.desktop", "gnome-at-session.desktop", "gnome-power-manager.desktop" ],
143                }
144            } 
145            Lucid: {
146                deshabilita_servicios { "/etc/xdg/autostart":
147                    archivos => [ "at-spi-registryd.desktop", "bluetooth-applet.desktop", "gwibber.desktop", "evolution-alarm-notify.desktop",  "indicator-applet.desktop", "gdu-notification-daemon.desktop",  "jockey-gtk.desktop", "gnome-at-session.desktop", "nm-applet.desktop", "gnome-keyring-pkcs11.desktop", "polkit-gnome-authentication-agent-1.desktop", "gnome-keyring-secrets.desktop", "polkit-kde-authentication-agent-1.desktop", "gnome-keyring-ssh.desktop", "print-applet.desktop", "gnome-power-manager.desktop", "pulseaudio.desktop", "update-notifier.desktop", "vino-server.desktop", "user-dirs-update-gtk.desktop", "gnome-user-share.desktop" ],
148                }
149            }
150            default: {
151                err("No hay deshabilitacion de servicios para $opertatingsystem - $lsbdistcodename")
152            }
153        }
154    }
155    default: {
156        err("No hay deshabilitacion de servicios para $operatingsystem")   
157    }
158    }   
159}
160
Note: See TracBrowser for help on using the repository browser.