From 1b42ed53a36b029ed6fb1b051b70d8c7c286f03a Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Tue, 26 Feb 2019 14:26:55 -0500 Subject: [PATCH] Added network backup Installed the amanda client on webserver to back it up. Changed host name of backup server from "amanda" to "backups." --- .../environments/production/manifests/site.pp | 1 + .../modules/amanda/manifests/client.pp | 22 +++++++++++++++++++ .../modules/amanda/manifests/init.pp | 9 +++++++- .../modules/amanda/templates/amanda.conf.epp | 3 +-- .../amanda/templates/amandahosts-client.epp | 2 ++ .../amanda/templates/amandahosts-server.epp | 2 ++ .../modules/amanda/templates/disklist.epp | 2 +- setup/roles/common/templates/hosts.j2 | 2 +- 8 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 code/environments/production/modules/amanda/manifests/client.pp create mode 100644 code/environments/production/modules/amanda/templates/amandahosts-client.epp create mode 100644 code/environments/production/modules/amanda/templates/amandahosts-server.epp diff --git a/code/environments/production/manifests/site.pp b/code/environments/production/manifests/site.pp index 6351278..fda3701 100644 --- a/code/environments/production/manifests/site.pp +++ b/code/environments/production/manifests/site.pp @@ -1,5 +1,6 @@ node 'webserver' { include wordpress + include amanda::client } node 'backups' { diff --git a/code/environments/production/modules/amanda/manifests/client.pp b/code/environments/production/modules/amanda/manifests/client.pp new file mode 100644 index 0000000..4b7ec41 --- /dev/null +++ b/code/environments/production/modules/amanda/manifests/client.pp @@ -0,0 +1,22 @@ +class amanda::client { + + # Install Amanda + package { ['amanda-client', 'amanda-common']: + ensure => present + } + + # Enable "backup" user account + user { 'backup': + ensure => present, + shell => "/bin/bash" + } + + # Deploy amanda hosts for clients + file { '/etc/amandahosts': + ensure => file, + content => template('amanda/amandahosts-client.epp'), + owner => "backup" + } + +} + diff --git a/code/environments/production/modules/amanda/manifests/init.pp b/code/environments/production/modules/amanda/manifests/init.pp index 2a04cf8..dc7c0f0 100644 --- a/code/environments/production/modules/amanda/manifests/init.pp +++ b/code/environments/production/modules/amanda/manifests/init.pp @@ -33,7 +33,7 @@ class amanda { owner => "backup" } - # Backup config + # Deploy config file { '/etc/amanda/MyConfig/amanda.conf': ensure => file, content => template('amanda/amanda.conf.epp'), @@ -47,5 +47,12 @@ class amanda { owner => "backup" } + # Deploy amanda hosts for the amanda server + file { '/etc/amandahosts': + ensure => file, + content => template('amanda/amandahosts-server.epp'), + owner => "backup" + } + } diff --git a/code/environments/production/modules/amanda/templates/amanda.conf.epp b/code/environments/production/modules/amanda/templates/amanda.conf.epp index 9a78e57..7fa54a1 100644 --- a/code/environments/production/modules/amanda/templates/amanda.conf.epp +++ b/code/environments/production/modules/amanda/templates/amanda.conf.epp @@ -17,8 +17,7 @@ define tapetype TEST-TAPE { filemark 4 kbytes } -define dumptype simple-gnutar-local { - auth "local" +define dumptype simple-gnutar-remote { compress none program "GNUTAR" } diff --git a/code/environments/production/modules/amanda/templates/amandahosts-client.epp b/code/environments/production/modules/amanda/templates/amandahosts-client.epp new file mode 100644 index 0000000..7522a92 --- /dev/null +++ b/code/environments/production/modules/amanda/templates/amandahosts-client.epp @@ -0,0 +1,2 @@ +backups backup amdump + diff --git a/code/environments/production/modules/amanda/templates/amandahosts-server.epp b/code/environments/production/modules/amanda/templates/amandahosts-server.epp new file mode 100644 index 0000000..eb075d0 --- /dev/null +++ b/code/environments/production/modules/amanda/templates/amandahosts-server.epp @@ -0,0 +1,2 @@ +localhost root amindexd amidxtaped + diff --git a/code/environments/production/modules/amanda/templates/disklist.epp b/code/environments/production/modules/amanda/templates/disklist.epp index 7045e29..264bb55 100644 --- a/code/environments/production/modules/amanda/templates/disklist.epp +++ b/code/environments/production/modules/amanda/templates/disklist.epp @@ -1,2 +1,2 @@ -localhost /etc simple-gnutar-local +webserver /var/www simple-gnutar-remote diff --git a/setup/roles/common/templates/hosts.j2 b/setup/roles/common/templates/hosts.j2 index 25b6939..da2a4c2 100644 --- a/setup/roles/common/templates/hosts.j2 +++ b/setup/roles/common/templates/hosts.j2 @@ -8,5 +8,5 @@ ff02::2 ip6-allrouters 192.168.121.100 puppet 192.168.121.101 webserver -192.168.121.102 amanda +192.168.121.102 backups