odania 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/odania/varnish.rb +1 -10
- data/lib/odania/version.rb +1 -1
- data/lib/odania.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e6ea9cc26aac7bc522c8c1b2cc013e2f8447eec
|
|
4
|
+
data.tar.gz: 12385a1121bb13a63b345e93cb03c07d5d68a637
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90754f18b3e3b4a9933f80af8f6d6c2f8b776d0cbabfdba331d617bb24edc122861ef5c314bf5fb3b352bf34136bddec10178b50e560148723e7b4a9e603da2f
|
|
7
|
+
data.tar.gz: 4a11f48c9655021c224a3b68fbad1e053528fbf58e6f66c8bb6aa86f6fcfa3b13e6a377e219cdd914c2b32ded1411cba54e383885f1742c9696559ed59a19f59
|
data/Gemfile.lock
CHANGED
data/lib/odania/varnish.rb
CHANGED
|
@@ -76,7 +76,7 @@ module Odania
|
|
|
76
76
|
|
|
77
77
|
ips = Odania.ips
|
|
78
78
|
plugin_config['plugin-config']['ips'] = ips
|
|
79
|
-
plugin_config['plugin-config']['ip'] = primary_ip(ips)
|
|
79
|
+
plugin_config['plugin-config']['ip'] = Odania.primary_ip(ips)
|
|
80
80
|
plugin_config['plugin-config']['port'] = 80
|
|
81
81
|
plugin_config['plugin-config']['tags'] = ["plugin-#{get_plugin_name}"]
|
|
82
82
|
puts JSON.pretty_generate plugin_config if $debug
|
|
@@ -85,15 +85,6 @@ module Odania
|
|
|
85
85
|
Odania.plugin.register plugin_instance_name, plugin_config
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
# Rancher assigns two ip's the ip starting with 10. is routed through the hosts
|
|
89
|
-
def primary_ip(ips)
|
|
90
|
-
ips.each do |ip|
|
|
91
|
-
return ip if ip.start_with? '10.'
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
ips.first
|
|
95
|
-
end
|
|
96
|
-
|
|
97
88
|
def get_plugin_name
|
|
98
89
|
'odania_varnish'
|
|
99
90
|
end
|
data/lib/odania/version.rb
CHANGED
data/lib/odania.rb
CHANGED
|
@@ -47,6 +47,15 @@ module Odania
|
|
|
47
47
|
ips
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
# Rancher assigns two ip's the ip starting with 10. is routed through the hosts
|
|
51
|
+
def self.primary_ip(ips)
|
|
52
|
+
ips.each do |ip|
|
|
53
|
+
return ip if ip.start_with? '10.'
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
ips.first
|
|
57
|
+
end
|
|
58
|
+
|
|
50
59
|
def self.varnish_sanitize(name)
|
|
51
60
|
raise 'Could not sanitize varnish name!!' if name.nil?
|
|
52
61
|
name.gsub(/[^0-9a-zA-Z_]/, '_')
|