only generate host_credential and mirror cronjob if dest_host is set
This commit is contained in:
parent
e4d31f76a7
commit
322bf6b63f
1 changed files with 16 additions and 14 deletions
|
@ -129,7 +129,7 @@ class md_repo_client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class md_signer($dest_host="localhost",$dest_dir="") {
|
class md_signer($dest_host=undef,$dest_dir="") {
|
||||||
sunet::snippets::secret_file {"/etc/credentials/metadata.key":
|
sunet::snippets::secret_file {"/etc/credentials/metadata.key":
|
||||||
hiera_key => 'eidas_metadata_key',
|
hiera_key => 'eidas_metadata_key',
|
||||||
base64 => true
|
base64 => true
|
||||||
|
@ -139,19 +139,21 @@ class md_signer($dest_host="localhost",$dest_dir="") {
|
||||||
pound_and_varnish => false,
|
pound_and_varnish => false,
|
||||||
pipeline => "${name}.fd",
|
pipeline => "${name}.fd",
|
||||||
volumes => ["/etc/credentials:/etc/credentials"]
|
volumes => ["/etc/credentials:/etc/credentials"]
|
||||||
} ->
|
}
|
||||||
sunet::ssh_host_credential { "${name}-publish-credential":
|
if ($dest_host) {
|
||||||
hostname => $dest_host,
|
sunet::ssh_host_credential { "${name}-publish-credential":
|
||||||
username => 'root',
|
hostname => $dest_host,
|
||||||
group => 'root',
|
username => 'root',
|
||||||
manage_user => false,
|
group => 'root',
|
||||||
ssh_privkey => safe_hiera("publisher_ssh_privkey")
|
manage_user => false,
|
||||||
} ->
|
ssh_privkey => safe_hiera("publisher_ssh_privkey")
|
||||||
sunet::scriptherder::cronjob { "${name}-publish":
|
} ->
|
||||||
cmd => "env RSYNC_ARGS='--chown=www-data:www-data --chmod=D0755,F0664' /usr/local/bin/mirror-mdq.sh http://localhost root@${dest_host}:${dest_dir}",
|
sunet::scriptherder::cronjob { "${name}-publish":
|
||||||
minute => '*/5',
|
cmd => "env RSYNC_ARGS='--chown=www-data:www-data --chmod=D0755,F0664' /usr/local/bin/mirror-mdq.sh http://localhost root@${dest_host}:${dest_dir}",
|
||||||
ok_criteria => ['exit_status=0'],
|
minute => '*/5',
|
||||||
warn_criteria => ['max_age=30m']
|
ok_criteria => ['exit_status=0'],
|
||||||
|
warn_criteria => ['max_age=30m']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue