Initial version of lynx module.

This commit is contained in:
Timo Mkinen 2011-04-20 11:37:19 +03:00
parent d266a6c760
commit 3c2f8981f8
2 changed files with 54 additions and 0 deletions

53
lynx/manifests/init.pp Normal file
View file

@ -0,0 +1,53 @@
# Install Lynx WWW browser
#
# === Global variables:
#
# $www_default_url:
# Default starting URL.
#
class lynx {
if ! $www_default_url {
$www_default_url = "http://www.${domain}"
}
if $operatingsystem != "OpenBSD" {
package { "lynx":
name => $operatingsystem ? {
"ubuntu" => "lynx-cur",
default => "lynx",
},
ensure => installed,
}
}
if $operatingsystem == "OpenBSD" {
exec { "add-local-lynx-config":
command => "echo 'INCLUDE:/etc/lynx-site.cfg' >> /etc/lynx.cfg",
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
user => root,
unless => "fgrep 'INCLUDE:/etc/lynx-site.cfg' /etc/lynx.cfg",
}
}
file { "lynx-site.cfg":
name => $operatingsystem ? {
"ubuntu" => "/etc/lynx-cur/local.cfg",
default => "/etc/lynx-site.cfg",
},
ensure => present,
content => template("lynx/lynx-site.cfg.erb"),
mode => 0644,
owner => "root",
group => $operatingsystem ? {
"openbsd" => "wheel",
default => "root",
},
require => $operatingsystem ? {
"openbsd" => undef,
default => Package["lynx"],
},
}
}

View file

@ -0,0 +1 @@
STARTFILE:<%= www_default_url %>