From ac6b29edd669e28ed384b76368a76d4b592d15d3 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 12:07:57 +0200 Subject: more etcd work --- .../etc/puppet/modules/sunet/manifests/etcd_node.pp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp new file mode 100644 index 0000000..68df7d2 --- /dev/null +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -0,0 +1,16 @@ +define etcd_node( + $disco_url = undef, + $etcd_version = 'v2.0.8' +) { + file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } + sunet::docker_run { "etcd_${name}": + image => 'quay.io/coreos/etcd', + version => $etcd_version, + extra_parameters => ["-initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + "-listen-peer-urls http://${::ipaddress_eth1}:2380", + "-discovery ${disco_url}", + "-name ${::hostname}", + "-data-dir /data/${name}/${::hostname}"], + ports => ["2380:2380"] + } +} -- cgit v1.1 From ba7258ce70516b1dee8437b57a3e713382699e5f Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 12:09:37 +0200 Subject: more etcd work --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 68df7d2..a6659b2 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -1,4 +1,4 @@ -define etcd_node( +define sunet::etcd_node( $disco_url = undef, $etcd_version = 'v2.0.8' ) { -- cgit v1.1 From 9881de1ec8952e31b6868a016b579450d3daa069 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 12:10:47 +0200 Subject: more etcd work --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index a6659b2..6a61f89 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -4,13 +4,13 @@ define sunet::etcd_node( ) { file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } sunet::docker_run { "etcd_${name}": - image => 'quay.io/coreos/etcd', - version => $etcd_version, + image => 'quay.io/coreos/etcd', + imagetag => $etcd_version, extra_parameters => ["-initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "-listen-peer-urls http://${::ipaddress_eth1}:2380", "-discovery ${disco_url}", "-name ${::hostname}", "-data-dir /data/${name}/${::hostname}"], - ports => ["2380:2380"] + ports => ["2380:2380"] } } -- cgit v1.1 From 1ab589a2d4567865e9389ba8bc7e656ac5220a44 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 12:33:01 +0200 Subject: etcd work --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 6a61f89..c114cd2 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -11,6 +11,6 @@ define sunet::etcd_node( "-discovery ${disco_url}", "-name ${::hostname}", "-data-dir /data/${name}/${::hostname}"], - ports => ["2380:2380"] + ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From 3d1ab0bddf7929b94fafdc8347e96c992c93ffff Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 12:47:11 +0200 Subject: etc foo --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index c114cd2..3d17691 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -1,16 +1,13 @@ define sunet::etcd_node( $disco_url = undef, $etcd_version = 'v2.0.8' -) { +) +{ file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - extra_parameters => ["-initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", - "-listen-peer-urls http://${::ipaddress_eth1}:2380", - "-discovery ${disco_url}", - "-name ${::hostname}", - "-data-dir /data/${name}/${::hostname}"], + command => "-initial-advertise-peer-urls http://${::ipaddress_eth1}:2380 -listen-peer-urls http://${::ipaddress_eth1}:2380 -discovery ${disco_url} -name ${::hostname} -data-dir /data/${name}/${::hostname}", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From 60b460b309d92c854e681a8178e04476866de330 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:18:39 +0200 Subject: infra ca & etc tls config --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 3d17691..3509114 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,7 +7,8 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - command => "-initial-advertise-peer-urls http://${::ipaddress_eth1}:2380 -listen-peer-urls http://${::ipaddress_eth1}:2380 -discovery ${disco_url} -name ${::hostname} -data-dir /data/${name}/${::hostname}", + volumes => ["/data/${name}/${::hostname}:/var/lib/etcd","/etc/ssl:/etc/ssl"] + command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --data-dir /var/lib/etcd --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From ae85c78ff1901412ba960d0aa14b80a6cac22802 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:20:22 +0200 Subject: infra ca & etc tls config --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 3509114..ee0966f 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,7 +7,7 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}/${::hostname}:/var/lib/etcd","/etc/ssl:/etc/ssl"] + volumes => ["/data/${name}/${::hostname}:/var/lib/etcd","/etc/ssl:/etc/ssl"], command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --data-dir /var/lib/etcd --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } -- cgit v1.1 From 8d537696dc0e044b1c9afc2c5284662d370bcf4f Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:30:31 +0200 Subject: infra ca & etc tls config --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index ee0966f..1874804 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,8 +7,8 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}/${::hostname}:/var/lib/etcd","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --data-dir /var/lib/etcd --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + volumes => ["/data/${name}/${::hostname}:/data","/etc/ssl:/etc/ssl"], + command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --data-dir /data --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From a014ad4df5932fca5a3221b9cb31f6ca304b248b Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:35:49 +0200 Subject: no datadir --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 1874804..2b5438d 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,8 +7,7 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}/${::hostname}:/data","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --data-dir /data --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From d22afe6a73cd9514d3ee83737d06a7c8302d591e Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:36:25 +0200 Subject: no datadir --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 2b5438d..c4d3e78 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,6 +7,7 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, + volumes => ["/etc/ssl:/etc/ssl"], command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } -- cgit v1.1 From 04d799dd38b7bb3cba2b67b71cf2e3532d1ba637 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 13:44:00 +0200 Subject: try to mount th secret datadir --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index c4d3e78..058dadd 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,7 +7,7 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/etc/ssl:/etc/ssl"], + volumes => ["/data/${name}/${::hostname}:/go/src/app/${::hostname}.etcd","/etc/ssl:/etc/ssl"], command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } -- cgit v1.1 From c27fcd33e1ba94220264dc56dc7606aa680e750c Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 14:03:06 +0200 Subject: silly datadir --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 058dadd..22b26a7 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,8 +7,8 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}/${::hostname}:/go/src/app/${::hostname}.etcd","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + volumes => ["/data/${name}/${::hostname}:/data","/etc/ssl:/etc/ssl"], + command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --data-dir /data --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From 9610479421abbef0a3db47d5be39287d64f2814d Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 14:15:02 +0200 Subject: silly datadir --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 22b26a7..a01d60b 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,8 +7,8 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}/${::hostname}:/data","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --data-dir /data --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + volumes => ["/data/${name}:/var/lib/etcd","/etc/ssl:/etc/ssl"], + command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380"] } } -- cgit v1.1 From e381cc05493964438da47cb65662990e86b34e8d Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 14:44:44 +0200 Subject: flags flags --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index a01d60b..d69b1c3 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -8,7 +8,7 @@ define sunet::etcd_node( image => 'quay.io/coreos/etcd', imagetag => $etcd_version, volumes => ["/data/${name}:/var/lib/etcd","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", - ports => ["${::ipaddress_eth1}:2380:2380"] + command => "--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380 --advertise-client-urls http://${::ipaddress_eth1}:2379 --listen-peer-urls http://0.0.0.0:2380 --listen-client-urls http://0.0.0.0:2379 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379"] } } -- cgit v1.1 From c772ff2d8ee44415f0e2d1da7bf09b7a73c1cdf0 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 14:49:40 +0200 Subject: ufw for etcd --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index d69b1c3..e9ae803 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -11,4 +11,12 @@ define sunet::etcd_node( command => "--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380 --advertise-client-urls http://${::ipaddress_eth1}:2379 --listen-peer-urls http://0.0.0.0:2380 --listen-client-urls http://0.0.0.0:2379 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379"] } + ufw::allow { "allow-etcd-peer": + ip => "${::ipaddress_eth1}", + port => 2380 + } + ufw::allow { "allow-etcd-client": + ip => "${::ipaddress_eth1}", + port => 2379 + } } -- cgit v1.1 From 9f64c5737b4c57944bb33d78409cded63d07351a Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 22:17:39 +0200 Subject: proxy nodes --- .../puppet/modules/sunet/manifests/etcd_node.pp | 42 ++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index e9ae803..4eb9776 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -1,22 +1,44 @@ define sunet::etcd_node( $disco_url = undef, - $etcd_version = 'v2.0.8' -) + $etcd_version = 'v2.0.8', + $proxy = true +) { + include stdlib + file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } + $args = ["--discovery ${disco_url}", + "--name ${::hostname}", + "--key-file /etc/ssl/private/${::fqdn}_infra.key", + "--ca-file /etc/ssl/certs/infra.crt", + "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] + if ($proxy) { + $args = concat($args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) + } else { + $args = concat($args, + "--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + "--advertise-client-urls http://${::ipaddress_eth1}:2379", + "--listen-peer-urls http://0.0.0.0:2380", + "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", + "--peer-key-file /etc/ssl/private/${::fqdn}_infra.key", + "--peer-ca-file /etc/ssl/certs/infra.crt", + "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"]) + } sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, volumes => ["/data/${name}:/var/lib/etcd","/etc/ssl:/etc/ssl"], - command => "--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380 --advertise-client-urls http://${::ipaddress_eth1}:2379 --listen-peer-urls http://0.0.0.0:2380 --listen-client-urls http://0.0.0.0:2379 --discovery ${disco_url} --name ${::hostname} --key-file /etc/ssl/private/${::fqdn}_infra.key --peer-key-file /etc/ssl/private/${::fqdn}_infra.key --ca-file /etc/ssl/certs/infra.crt --peer-ca-file /etc/ssl/certs/infra.crt --cert-file /etc/ssl/certs/${::fqdn}_infra.crt --peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt", + command => join($args," "), ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379"] } - ufw::allow { "allow-etcd-peer": - ip => "${::ipaddress_eth1}", - port => 2380 - } - ufw::allow { "allow-etcd-client": - ip => "${::ipaddress_eth1}", - port => 2379 + if (not $proxy) { + ufw::allow { "allow-etcd-peer": + ip => "${::ipaddress_eth1}", + port => 2380 + } + ufw::allow { "allow-etcd-client": + ip => "${::ipaddress_eth1}", + port => 2379 + } } } -- cgit v1.1 From f8586d18a3f069774235044e1145c09a121edb0c Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 23:46:52 +0200 Subject: proxy --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 4eb9776..429950e 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -16,7 +16,7 @@ define sunet::etcd_node( $args = concat($args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) } else { $args = concat($args, - "--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "--advertise-client-urls http://${::ipaddress_eth1}:2379", "--listen-peer-urls http://0.0.0.0:2380", "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", -- cgit v1.1 From fcc7ab131530166ea997a238aac7bf6182f5f6de Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 23:48:26 +0200 Subject: fix if --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 429950e..97927b4 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -12,7 +12,7 @@ define sunet::etcd_node( "--key-file /etc/ssl/private/${::fqdn}_infra.key", "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] - if ($proxy) { + if $proxy { $args = concat($args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) } else { $args = concat($args, @@ -31,7 +31,7 @@ define sunet::etcd_node( command => join($args," "), ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379"] } - if (not $proxy) { + if !$proxy { ufw::allow { "allow-etcd-peer": ip => "${::ipaddress_eth1}", port => 2380 -- cgit v1.1 From 9df927868a9c66f4ba568dc33ec925eed079baaa Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 23:50:35 +0200 Subject: concat --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 97927b4..6b3898f 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -13,16 +13,15 @@ define sunet::etcd_node( "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] if $proxy { - $args = concat($args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) + $args += ["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"] } else { - $args = concat($args, - ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + $args += ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "--advertise-client-urls http://${::ipaddress_eth1}:2379", "--listen-peer-urls http://0.0.0.0:2380", "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", "--peer-key-file /etc/ssl/private/${::fqdn}_infra.key", "--peer-ca-file /etc/ssl/certs/infra.crt", - "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"]) + "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] } sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', -- cgit v1.1 From 465cfea95609aaf6ea4402c3ac41be3250a37ba7 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 23:58:29 +0200 Subject: scoping hell part1 --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 6b3898f..0a50db6 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -7,15 +7,15 @@ define sunet::etcd_node( include stdlib file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } - $args = ["--discovery ${disco_url}", + $common_args = ["--discovery ${disco_url}", "--name ${::hostname}", "--key-file /etc/ssl/private/${::fqdn}_infra.key", "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] if $proxy { - $args += ["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"] + $args = $common_args + ["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"] } else { - $args += ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + $args = $common_args + ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "--advertise-client-urls http://${::ipaddress_eth1}:2379", "--listen-peer-urls http://0.0.0.0:2380", "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", -- cgit v1.1 From 18216c529fe3c4ba2e793c948cd901de3a76eed6 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 16 Apr 2015 23:59:51 +0200 Subject: scoping hell part2 --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 0a50db6..96e88cf 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -13,15 +13,15 @@ define sunet::etcd_node( "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] if $proxy { - $args = $common_args + ["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"] + $args = concat($common_args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) } else { - $args = $common_args + ["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", + $args = concat($common_args,["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "--advertise-client-urls http://${::ipaddress_eth1}:2379", "--listen-peer-urls http://0.0.0.0:2380", "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", "--peer-key-file /etc/ssl/private/${::fqdn}_infra.key", "--peer-ca-file /etc/ssl/certs/infra.crt", - "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] + "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"]) } sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', -- cgit v1.1 From cb8a3cc80f6f5d08762fb30108f398bfd25a0eb1 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 17 Apr 2015 00:10:06 +0200 Subject: ports ports --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 96e88cf..1644d8b 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -13,12 +13,12 @@ define sunet::etcd_node( "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] if $proxy { - $args = concat($common_args,["--proxy on","--listen-client-urls http://${::ipaddress_docker0}:2379,http://127.0.0.1:4001,http://127.0.0.1:2379"]) + $args = concat($common_args,["--proxy on","--listen-client-urls http://0.0.0.0:4001,http://0.0.0.0:2379"]) } else { $args = concat($common_args,["--initial-advertise-peer-urls http://${::ipaddress_eth1}:2380", "--advertise-client-urls http://${::ipaddress_eth1}:2379", "--listen-peer-urls http://0.0.0.0:2380", - "--listen-client-urls http://0.0.0.0:2379,http://${::ipaddress_docker0}:2379", + "--listen-client-urls http://0.0.0.0:4001,http://0.0.0.0:2379", "--peer-key-file /etc/ssl/private/${::fqdn}_infra.key", "--peer-ca-file /etc/ssl/certs/infra.crt", "--peer-cert-file /etc/ssl/certs/${::fqdn}_infra.crt"]) @@ -28,7 +28,7 @@ define sunet::etcd_node( imagetag => $etcd_version, volumes => ["/data/${name}:/var/lib/etcd","/etc/ssl:/etc/ssl"], command => join($args," "), - ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379"] + ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379","${::ipaddress_docker0}:4001:2379"] } if !$proxy { ufw::allow { "allow-etcd-peer": -- cgit v1.1 From de4cd333d5b773c4bcb7908bbe72863433963225 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 17 Apr 2015 00:43:20 +0200 Subject: datadir part n --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 1644d8b..7ebfd17 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -9,6 +9,7 @@ define sunet::etcd_node( file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } $common_args = ["--discovery ${disco_url}", "--name ${::hostname}", + "--data-dir /data", "--key-file /etc/ssl/private/${::fqdn}_infra.key", "--ca-file /etc/ssl/certs/infra.crt", "--cert-file /etc/ssl/certs/${::fqdn}_infra.crt"] @@ -26,7 +27,7 @@ define sunet::etcd_node( sunet::docker_run { "etcd_${name}": image => 'quay.io/coreos/etcd', imagetag => $etcd_version, - volumes => ["/data/${name}:/var/lib/etcd","/etc/ssl:/etc/ssl"], + volumes => ["/data/${name}:/data","/etc/ssl:/etc/ssl"], command => join($args," "), ports => ["${::ipaddress_eth1}:2380:2380","${::ipaddress_eth1}:2379:2379","${::ipaddress_docker0}:4001:2379"] } -- cgit v1.1 From 2fd221bd8ab2f2d0b7353b1b2d90bac1816a086d Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 17 Apr 2015 00:50:42 +0200 Subject: proxy on appservers --- global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp index 7ebfd17..a80d355 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/etcd_node.pp @@ -6,7 +6,7 @@ define sunet::etcd_node( { include stdlib - file { ["/data","/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } + file { ["/data/${name}","/data/${name}/${::hostname}"]: ensure => 'directory' } $common_args = ["--discovery ${disco_url}", "--name ${::hostname}", "--data-dir /data", -- cgit v1.1