summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2015-09-23 14:52:51 +0200
committerLeif Johansson <leifj@sunet.se>2015-09-23 14:52:51 +0200
commitbcee6cb403be4ba72e0b06a8619384a9f044d881 (patch)
tree29823a0b533f899a81dbfa0ad1946bd1e076a11b
parent1c726d7e64b7dbe5bee07a78c73695033a7d1576 (diff)
new signer definitionssunet-ops-2015-09-23-v14
-rw-r--r--global/overlay/etc/puppet/cosmos-rules.yaml6
-rw-r--r--global/overlay/etc/puppet/manifests/cosmos-site.pp49
2 files changed, 19 insertions, 36 deletions
diff --git a/global/overlay/etc/puppet/cosmos-rules.yaml b/global/overlay/etc/puppet/cosmos-rules.yaml
index 718ce2a..3fda18d 100644
--- a/global/overlay/etc/puppet/cosmos-rules.yaml
+++ b/global/overlay/etc/puppet/cosmos-rules.yaml
@@ -21,11 +21,9 @@ docker.sunet.se:
dockerhost:
webserver:
mdx1.swamid.se:
- dockerhost:
- signer:
+ swamid_pyff_signer:
mdx2.swamid.se:
- dockerhost:
- docker_signer:
+ swamid_pyff_signer:
sto-tug-kvm2.swamid.se:
webserver:
sunet::dockerhost:
diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp
index f04fd87..d9ac384 100644
--- a/global/overlay/etc/puppet/manifests/cosmos-site.pp
+++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp
@@ -165,45 +165,25 @@ node 'docker.sunet.se' {
}
}
-class docker_signer {
- docker::image {'docker.samlbits.net/varnish': }
- docker::image {'docker.samlbits.net/pyff': }
- docker::run {'pyff':
+define pyff($dir) {
+ sunet::docker_run {'pyff_${name}':
image => 'docker.samlbits.net/pyff',
- volumes => ['/opt/swamid-metadata:/opt/swamid-metadata'],
- env => ['DATADIR=/opt/swamid-metadata','LOGLEVEL=INFO']
+ volumes => ["${dir}:${dir}"],
+ env => ['DATADIR=${dir}','LOGLEVEL=INFO']
}
- docker::run {'varnish':
+ docker::run {'varnish_${name}':
image => 'docker.samlbits.net/varnish',
- links => ['pyff:backend'],
+ env => ['BACKEND_PORT=tcp://pyff.varnish:80'],
ports => ['80:80']
}
- cron {'update-swamid-metadata':
- command => "cd /opt/swamid-metadata && git pull -q",
- user => root,
- minute => '*/5'
- }
}
-class signer {
- include cosmos::httpsproxy
- class {'varnish':
- domain => 'swamid.se',
- backends => {
- mdx => 'http://localhost:8000/'
- },
- vhosts => {
- mdx => 'mdx.swamid.se'
- }
- }
- class {'pyff':
- load => ["/opt/metadata"],
- port => 8000,
- address => '0.0.0.0',
- validUntil => 'P10D',
- cacheDuration => 'PT5H',
- replace => false
- }
+class swamid_metadata {
+ vcsrepo { '/opt/swamid-metadata':
+ ensure => present
+ provider => git,
+ source => 'git://md-master.swamid.se/swamid-metadata.git'
+ } ->
cron {'update-swamid-metadata':
command => "cd /opt/swamid-metadata && git pull -q",
user => root,
@@ -211,6 +191,11 @@ class signer {
}
}
+class swamid_pyff_signer {
+ class { 'swamid_metadata': }
+ pyff {'swamid': dir => '/opt/swamid-metadata' }
+}
+
node 'md-master.reep.refeds.org' {
#include cosmos::httpsproxy
class {'pyff':