diff options
author | elijah <elijah@riseup.net> | 2013-04-30 14:25:45 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-04-30 14:25:45 -0700 |
commit | c8e427c39285a0ac8750c1b9bbf247533bbce519 (patch) | |
tree | 1a9472ec6c15e8c79df9ce01196fdb17906b18a0 | |
parent | b54161a12561c5983f6bc5215f764a1f46a4bd1f (diff) |
added soledad-service.json
-rw-r--r-- | provider_base/common.json | 3 | ||||
-rw-r--r-- | provider_base/files/service-definitions/v1/eip-service.json.erb | 2 | ||||
-rw-r--r-- | provider_base/files/service-definitions/v1/soledad-service.json.erb | 29 | ||||
-rw-r--r-- | provider_base/services/soledad.json | 6 | ||||
-rw-r--r-- | provider_base/services/webapp.json | 3 | ||||
-rw-r--r-- | puppet/modules/site_webapp/manifests/init.pp | 11 |
6 files changed, 48 insertions, 6 deletions
diff --git a/provider_base/common.json b/provider_base/common.json index dc59b88e..e89fce7e 100644 --- a/provider_base/common.json +++ b/provider_base/common.json @@ -29,5 +29,6 @@ "development": { "site_config": true }, - "name": "common" + "name": "common", + "location": null } diff --git a/provider_base/files/service-definitions/v1/eip-service.json.erb b/provider_base/files/service-definitions/v1/eip-service.json.erb index ca42bef5..9ee489de 100644 --- a/provider_base/files/service-definitions/v1/eip-service.json.erb +++ b/provider_base/files/service-definitions/v1/eip-service.json.erb @@ -14,7 +14,7 @@ gateway["host"] = node.domain.full gateway["ip_address"] = options[:ip] gateway["capabilities"]["limited"] = options[:limited] - if node.location + if node['location'] location_name = underscore(node.location.name) gateway["location"] = location_name locations[location_name] ||= node.location diff --git a/provider_base/files/service-definitions/v1/soledad-service.json.erb b/provider_base/files/service-definitions/v1/soledad-service.json.erb new file mode 100644 index 00000000..4d345930 --- /dev/null +++ b/provider_base/files/service-definitions/v1/soledad-service.json.erb @@ -0,0 +1,29 @@ +<%= + def underscore(words) + words = words.to_s.dup + words.downcase! + words.gsub! /[^a-z]/, '_' + words + end + + hsh = {} + hsh["serial"] = 1 + hsh["version"] = 1 + locations = {} + hosts = {} + nodes_like_me[:services => 'soledad'].each_node do |node| + host = {} + host["hostname"] = node.domain.full + host["ip_address"] = node.ip_address + host["port"] = node.soledad.port + if node['location'] + location_name = underscore(node.location.name) + host["location"] = location_name + locations[location_name] ||= node.location + end + hosts[node.name] = host + end + hsh["hosts"] = hosts + hsh["locations"] = locations + generate_json hsh +%>
\ No newline at end of file diff --git a/provider_base/services/soledad.json b/provider_base/services/soledad.json new file mode 100644 index 00000000..10657563 --- /dev/null +++ b/provider_base/services/soledad.json @@ -0,0 +1,6 @@ +{ + "service_type": "public_service", + "soledad": { + "port": 1111 + } +}
\ No newline at end of file diff --git a/provider_base/services/webapp.json b/provider_base/services/webapp.json index e4926ba7..4b2f7c26 100644 --- a/provider_base/services/webapp.json +++ b/provider_base/services/webapp.json @@ -22,7 +22,8 @@ }, "definition_files": { "provider": "= file :provider_json_template", - "eip_service": "= file [:eip_service_json_template, 'v'+webapp.api_version.to_s]" + "eip_service": "= file [:eip_service_json_template, 'v'+webapp.api_version.to_s]", + "soledad_service": "= file [:soledad_service_json_template, 'v'+webapp.api_version.to_s]" }, "service_type": "public_service", "api": { diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp index 8b5bb0e3..8e0aa11c 100644 --- a/puppet/modules/site_webapp/manifests/init.pp +++ b/puppet/modules/site_webapp/manifests/init.pp @@ -3,6 +3,7 @@ class site_webapp { $definition_files = hiera('definition_files') $provider = $definition_files['provider'] $eip_service = $definition_files['eip_service'] + $soledad_service = $definition_files['soledad_service'] $node_domain = hiera('domain') $provider_domain = $node_domain['full_suffix'] $webapp = hiera('webapp') @@ -80,17 +81,21 @@ class site_webapp { ensure => link, target => '/usr/local/share/ca-certificates/leap_api.crt'; - '/srv/leap-webapp/public/config': + "/srv/leap-webapp/public/${api_version}": ensure => directory, owner => leap-webapp, group => leap-webapp, mode => '0755'; - "/srv/leap-webapp/public/config/${api_version}": + "/srv/leap-webapp/public/${api_version}/config/": ensure => directory, owner => leap-webapp, group => leap-webapp, mode => '0755'; - "/srv/leap-webapp/public/config/${api_version}/eip-service.json": + "/srv/leap-webapp/public/${api_version}/config/eip-service.json": content => $eip_service, owner => leap-webapp, group => leap-webapp, mode => '0644'; + + "/srv/leap-webapp/public/${api_version}/config/soledad-service.json": + content => $soledad_service, + owner => leap-webapp, group => leap-webapp, mode => '0644'; } try::file { |