diff --git a/amanda/lib/facter/amanda.rb b/amanda/lib/facter/amanda.rb deleted file mode 100644 index 3e4a93d..0000000 --- a/amanda/lib/facter/amanda.rb +++ /dev/null @@ -1,29 +0,0 @@ -Facter.add('amanda_serverkey') do - confine :kernel => :linux - setcode do - begin - match = File.read('/var/lib/amanda/.ssh/id_rsa_amdump.pub')[/^ssh-rsa ([^ ]+)/, 1] - if match - data = match - end - rescue - data = '' - end - data - end -end - -Facter.add('amanda_clientkey') do - confine :kernel => :linux - setcode do - begin - match = File.read('/var/lib/amanda/.ssh/id_rsa_amrecover.pub')[/^ssh-rsa ([^ ]+)/, 1] - if match - data = match - end - rescue - data = '' - end - data - end -end diff --git a/amanda/manifests/init.pp b/amanda/manifests/init.pp deleted file mode 100644 index 8e4875e..0000000 --- a/amanda/manifests/init.pp +++ /dev/null @@ -1,90 +0,0 @@ -class amanda::common { - - file { "/var/lib/amanda/.ssh": - ensure => directory, - mode => "0700", - owner => "amandabackup", - group => "disk", - } - - file { "/var/lib/amanda/.ssh/authorized_keys": - ensure => present, - mode => "0600", - owner => "amandabackup", - group => "disk", - require => File["/var/lib/amanda/.ssh"], - } - -} - - -class amanda::client inherits amanda::common { - - if !$amanda_server { - fail("\$amanda_server must be defined.") - } - - if !$amanda_client { - $amanda_client = $ipaddress - } - - include inetd::server - - package { "amanda-enterprise-backup-client": - ensure => installed, - before => File["/var/lib/amanda/.ssh"], - require => Class["inetd::server"], - } - - file { [ "/etc/xinetd.d/amandaclient", - "/etc/xinetd.d/zmrecover", ]: - ensure => absent, - notify => Service["xinetd"], - require => Package["amanda-enterprise-backup-client"], - } - - file { "/etc/amanda/amanda-client.conf": - ensure => present, - mode => "0644", - owner => "amandabackup", - group => "disk", - content => template("amanda/amanda-client.conf.erb"), - require => Package["amanda-enterprise-backup-client"], - } - - if $amanda_clientkey { - @@ssh_authorized_key { "amrecover@${homename}": - ensure => present, - key => $amanda_clientkey, - type => "ssh-rsa", - user => "amandabackup", - tag => "amandaclient", - options => [ "no-agent-forwarding", "no-port-forwarding", "no-X11-forwarding", - "command=\"/usr/lib/amanda/amandad -auth=ssh amindexd amidxtaped\"", - "from=\"${amanda_client}\"", ], - } - } - - Ssh_authorized_key <<| tag == "amandaserver" |>> - -} - - -class amanda::server inherits amanda::common { - - if $amanda_serverkey { - @@ssh_authorized_key { "amdump@${homename}": - ensure => present, - key => $amanda_serverkey, - type => "ssh-rsa", - user => "amandabackup", - tag => "amandaserver", - options => [ "no-agent-forwarding", "no-port-forwarding", "no-X11-forwarding", - "command=\"/usr/lib/amanda/amandad -auth=ssh amdump\"", - "from=\"${amanda_server}\"", ], - } - } - - Ssh_authorized_key <<| tag == "amandaclient" |>> - -} diff --git a/amanda/templates/amanda-client.conf.erb b/amanda/templates/amanda-client.conf.erb deleted file mode 100644 index d22db28..0000000 --- a/amanda/templates/amanda-client.conf.erb +++ /dev/null @@ -1,9 +0,0 @@ -# amanda.conf - sample Amanda client configuration file. -# -# This file normally goes in /etc/amanda/amanda-client.conf. -# - -index_server "<%= @amanda_server %>" -tape_server "<%= @amanda_server %>" -auth "ssh" -ssh_keys "/var/lib/amanda/.ssh/id_rsa_amrecover"