From 77804f22bf3e76f3080f27f426aa8dbc8c86b87d Mon Sep 17 00:00:00 2001 From: Georg Kunz Date: Fri, 3 Feb 2017 10:38:42 +0100 Subject: Restructuring Gluon puppet manifests Structuring the puppet manifests similar to how it is done in OpenDaylight and etcd. Change-Id: I9d0fb60ddd626129b38b1f642ce3894ca3098cc4 Signed-off-by: Georg Kunz --- deploy/puppet/gluon/manifests/config.pp | 11 ++++++++ deploy/puppet/gluon/manifests/gluon-install.pp | 4 --- deploy/puppet/gluon/manifests/gluon-post.pp | 4 --- deploy/puppet/gluon/manifests/init.pp | 15 +++++++++++ deploy/puppet/gluon/manifests/install.pp | 11 ++++++++ deploy/puppet/gluon/manifests/params.pp | 10 +++++++ deploy/puppet/gluon/manifests/service.pp | 13 +++++++++ .../puppet/gluon/modules/gluon/manifests/init.pp | 1 - .../gluon/modules/gluon/manifests/install.pp | 11 -------- .../puppet/gluon/modules/gluon/manifests/post.pp | 11 -------- .../modules/gluon/templates/proton-shim.conf.erb | 31 ---------------------- deploy/puppet/gluon/templates/proton-shim.conf.erb | 31 ++++++++++++++++++++++ 12 files changed, 91 insertions(+), 62 deletions(-) create mode 100644 deploy/puppet/gluon/manifests/config.pp delete mode 100644 deploy/puppet/gluon/manifests/gluon-install.pp delete mode 100644 deploy/puppet/gluon/manifests/gluon-post.pp create mode 100644 deploy/puppet/gluon/manifests/init.pp create mode 100644 deploy/puppet/gluon/manifests/install.pp create mode 100644 deploy/puppet/gluon/manifests/params.pp create mode 100644 deploy/puppet/gluon/manifests/service.pp delete mode 100755 deploy/puppet/gluon/modules/gluon/manifests/init.pp delete mode 100644 deploy/puppet/gluon/modules/gluon/manifests/install.pp delete mode 100755 deploy/puppet/gluon/modules/gluon/manifests/post.pp delete mode 100644 deploy/puppet/gluon/modules/gluon/templates/proton-shim.conf.erb create mode 100644 deploy/puppet/gluon/templates/proton-shim.conf.erb diff --git a/deploy/puppet/gluon/manifests/config.pp b/deploy/puppet/gluon/manifests/config.pp new file mode 100644 index 0000000..4cfad19 --- /dev/null +++ b/deploy/puppet/gluon/manifests/config.pp @@ -0,0 +1,11 @@ +class gluon::config { + + file { '/etc/proton/proton-shim.conf': + ensure => 'file', + owner => 'proton', + group => 'proton', + mode => '640', + content => template('gluon/proton-shim.conf.erb'), + } + +} diff --git a/deploy/puppet/gluon/manifests/gluon-install.pp b/deploy/puppet/gluon/manifests/gluon-install.pp deleted file mode 100644 index c694b32..0000000 --- a/deploy/puppet/gluon/manifests/gluon-install.pp +++ /dev/null @@ -1,4 +0,0 @@ -notice('MODULAR: gluon-install.pp') -include gluon - -class { 'gluon::install': } diff --git a/deploy/puppet/gluon/manifests/gluon-post.pp b/deploy/puppet/gluon/manifests/gluon-post.pp deleted file mode 100644 index e32f424..0000000 --- a/deploy/puppet/gluon/manifests/gluon-post.pp +++ /dev/null @@ -1,4 +0,0 @@ -notice('MODULAR: gluon-post.pp') -include gluon - -class { 'gluon::post': } diff --git a/deploy/puppet/gluon/manifests/init.pp b/deploy/puppet/gluon/manifests/init.pp new file mode 100644 index 0000000..ec1e036 --- /dev/null +++ b/deploy/puppet/gluon/manifests/init.pp @@ -0,0 +1,15 @@ +class gluon inherits ::gluon::params { + + $odl_bind_ip = hiera(opendaylight::odl_bind_ip, $::gluon::params::odl_bind_ip) + $odl_rest_port = hiera(opendaylight::odl_rest_port, $::gluon::params::odl_rest_port) + $odl_username = hiera(opendaylight::username, $::gluon::params::odl_username) + $odl_password = hiera(opendaylight::password, $::gluon::params::odl_password) + $etcd_bind_ip = hiera(etcd::bind_ip, $::gluon::params::etcd_bind_ip) + $etcd_client_port = hiera(etcd::client_port, $::gluon::params::etcd_client_port) + + class { '::gluon::install': } -> + class { '::gluon::config': } ~> + class { '::gluon::service': } -> + Class['::gluon'] + +} diff --git a/deploy/puppet/gluon/manifests/install.pp b/deploy/puppet/gluon/manifests/install.pp new file mode 100644 index 0000000..234da49 --- /dev/null +++ b/deploy/puppet/gluon/manifests/install.pp @@ -0,0 +1,11 @@ +class gluon::install { + + package { 'python-click': + ensure => installed, + } + + package { 'gluon': + ensure => installed, + } + +} diff --git a/deploy/puppet/gluon/manifests/params.pp b/deploy/puppet/gluon/manifests/params.pp new file mode 100644 index 0000000..2af3cb7 --- /dev/null +++ b/deploy/puppet/gluon/manifests/params.pp @@ -0,0 +1,10 @@ +class gluon::params { + + $odl_bind_ip = '0.0.0.0' + $odl_rest_port = '8181' + $odl_username = 'admin' + $odl_password = 'admin' + $etcd_bind_ip = '127.0.0.1' + $etcd_client_port = '2379' + +} diff --git a/deploy/puppet/gluon/manifests/service.pp b/deploy/puppet/gluon/manifests/service.pp new file mode 100644 index 0000000..b909d54 --- /dev/null +++ b/deploy/puppet/gluon/manifests/service.pp @@ -0,0 +1,13 @@ +class gluon::service { + + service { 'openstack-proton-server': + ensure => running, + enable => true, + } + + service { 'openstack-proton-shim-server': + ensure => running, + enable => true, + } + +} diff --git a/deploy/puppet/gluon/modules/gluon/manifests/init.pp b/deploy/puppet/gluon/modules/gluon/manifests/init.pp deleted file mode 100755 index 77f22a9..0000000 --- a/deploy/puppet/gluon/modules/gluon/manifests/init.pp +++ /dev/null @@ -1 +0,0 @@ -class gluon { } diff --git a/deploy/puppet/gluon/modules/gluon/manifests/install.pp b/deploy/puppet/gluon/modules/gluon/manifests/install.pp deleted file mode 100644 index 28dbca2..0000000 --- a/deploy/puppet/gluon/modules/gluon/manifests/install.pp +++ /dev/null @@ -1,11 +0,0 @@ -class gluon::install inherits gluon { - - package { 'python-click': - ensure => installed, - } - - package { 'gluon': - ensure => installed, - } - -} diff --git a/deploy/puppet/gluon/modules/gluon/manifests/post.pp b/deploy/puppet/gluon/modules/gluon/manifests/post.pp deleted file mode 100755 index dc3ac21..0000000 --- a/deploy/puppet/gluon/modules/gluon/manifests/post.pp +++ /dev/null @@ -1,11 +0,0 @@ -class gluon::post inherits gluon { - - file { '/etc/proton/proton-shim.conf': - ensure => 'file', - owner => 'proton', - group => 'proton', - mode => 'go+w', - content => template('gluon/proton-shim.conf.erb'), - } - -} diff --git a/deploy/puppet/gluon/modules/gluon/templates/proton-shim.conf.erb b/deploy/puppet/gluon/modules/gluon/templates/proton-shim.conf.erb deleted file mode 100644 index 3391202..0000000 --- a/deploy/puppet/gluon/modules/gluon/templates/proton-shim.conf.erb +++ /dev/null @@ -1,31 +0,0 @@ -[shim] -# IP of the etcd server -etcd_host = <%= scope.function_hiera(['etcd::bind_ip']) %> - -# Port of the etcd server -etcd_port = <%= scope.function_hiera(['etcd::client_port']) %> - -# The shim server only handles bind requests for ports on specific compute hosts. This -# configuration option allows to specify a list of compute hosts or '*' as wildcard -# matching all hosts -# host_list = host1,host2,host3 -host_list = * - -# Select the model to load with the corresponding backend. This config option is a dict -# where the key represents the name of the model and the value the name of the backend -# which is to be used for this model. -handlers = net-l3vpn:net-l3vpn-odl - - -[shim_odl] -# IP of the OpenDaylight RESTconf interface. Typically needs to be changed after installation. -odl_host = <%= scope.function_hiera(['opendaylight::odl_bind_ip']) %> - -# Default port of the RESTconf interface. -odl_port = <%= scope.function_hiera(['opendaylight::odl_rest_port']) %> - -# Default user for accessing the OpenDaylight RESTconf interface -odl_user = <%= scope.function_hiera(['opendaylight::username']) %> - -# Default password of the default user for accessing the OpenDaylight RESTconf interface -odl_passwd = <%= scope.function_hiera(['opendaylight::password']) %> diff --git a/deploy/puppet/gluon/templates/proton-shim.conf.erb b/deploy/puppet/gluon/templates/proton-shim.conf.erb new file mode 100644 index 0000000..e8470d5 --- /dev/null +++ b/deploy/puppet/gluon/templates/proton-shim.conf.erb @@ -0,0 +1,31 @@ +[shim] +# IP of the etcd server +etcd_host = <%= scope.lookupvar('gluon::etcd_bind_ip') %> + +# Port of the etcd server +etcd_port = <%= scope.lookupvar('gluon::etcd_client_port') %> + +# The shim server only handles bind requests for ports on specific compute hosts. This +# configuration option allows to specify a list of compute hosts or '*' as wildcard +# matching all hosts +# host_list = host1,host2,host3 +host_list = * + +# Select the model to load with the corresponding backend. This config option is a dict +# where the key represents the name of the model and the value the name of the backend +# which is to be used for this model. +handlers = net-l3vpn:net-l3vpn-odl + + +[shim_odl] +# IP of the OpenDaylight RESTconf interface. Typically needs to be changed after installation. +odl_host = <%= scope.lookupvar('gluon::odl_bind_ip') %> + +# Default port of the RESTconf interface. +odl_port = <%= scope.lookupvar('gluon::odl_rest_port') %> + +# Default user for accessing the OpenDaylight RESTconf interface +odl_user = <%= scope.lookupvar('gluon::odl_username') %> + +# Default password of the default user for accessing the OpenDaylight RESTconf interface +odl_passwd = <%= scope.lookupvar('gluon::odl_password') %> -- cgit 1.2.3-korg