Merge lp:~thomnico/orange-box-examples/orange-box-tips into lp:orange-box-examples

Proposed by Nicolas Thomas
Status: Merged
Merged at revision: 56
Proposed branch: lp:~thomnico/orange-box-examples/orange-box-tips
Merge into: lp:orange-box-examples
Diff against target: 266 lines (+228/-2)
5 files modified
bin/orange-box-resetproxy (+34/-0)
telco/README (+12/-1)
telco/bundle-telco-store.yaml (+122/-0)
telco/integrate-with-ext-zabbix (+59/-0)
zabbix/install-on-machine (+1/-1)
To merge this branch: bzr merge lp:~thomnico/orange-box-examples/orange-box-tips
Reviewer Review Type Date Requested Status
Darryl Weaver Pending
Review via email: mp+240013@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'bin/orange-box-resetproxy'
2--- bin/orange-box-resetproxy 1970-01-01 00:00:00 +0000
3+++ bin/orange-box-resetproxy 2014-10-29 15:02:22 +0000
4@@ -0,0 +1,34 @@
5+#!/bin/bash
6+#
7+# orange-box-resetproxy
8+# Copyright (C) 2014 Canonical Ltd.
9+#
10+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as published by
14+# the Free Software Foundation, version 3 of the License.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU General Public License for more details.
20+#
21+# You should have received a copy of the GNU General Public License
22+# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
24+set -ex
25+# Only run this as root
26+if [ $EUID -ne 0 ]
27+then
28+ echo Execute as root or with \"sudo $0\"
29+ exit 1
30+fi
31+
32+
33+
34+service maas-proxy stop
35+rm -rf /var/spool/maas-proxy/*
36+squid3 -z -f /etc/maas/maas-proxy.conf
37+sleep 20
38+service maas-proxy start
39
40=== modified file 'telco/README'
41--- telco/README 2014-10-21 10:16:11 +0000
42+++ telco/README 2014-10-29 15:02:22 +0000
43@@ -4,7 +4,18 @@
44
45 Doing a local copy to be able to have the images as it comes from a personnal namespace.
46
47+Once started and if you create a zabbix machine run:
48+
49+integrate-with-ext-zabbix <IP of the zabbix machine>
50+
51+
52+If bzr-sync-local-charms failed do this :
53+juju-deployer -c bundle-telco-store.yaml
54+
55+#Or drag and drop the only drawback is not having the logos on the gui.
56+
57+
58 TODO:
59 automate users creation
60- script document integration with zabbix
61+
62
63
64=== added file 'telco/bundle-telco-store.yaml'
65--- telco/bundle-telco-store.yaml 1970-01-01 00:00:00 +0000
66+++ telco/bundle-telco-store.yaml 2014-10-29 15:02:22 +0000
67@@ -0,0 +1,122 @@
68+phone-network:
69+ services:
70+ "clearwater-bono":
71+ charm: "cs:~thomnico/precise/clearwater-bono"
72+ num_units: 1
73+ options:
74+ zone: clearwater.local
75+ constraints: arch=amd64
76+ expose: true
77+ annotations:
78+ "gui-x": "400"
79+ "gui-y": "900"
80+ "clearwater-ellis":
81+ charm: "cs:~thomnico/precise/clearwater-ellis"
82+ num_units: 1
83+ options:
84+ base_number: "1234567000"
85+ number_count: 1000
86+ signup_key: signup
87+ zone: clearwater.local
88+ constraints: arch=amd64
89+ expose: true
90+ annotations:
91+ "gui-x": "400"
92+ "gui-y": "0"
93+ "clearwater-homer":
94+ charm: "cs:~thomnico/precise/clearwater-homer"
95+ num_units: 1
96+ options:
97+ zone: clearwater.local
98+ constraints: arch=amd64
99+ expose: true
100+ annotations:
101+ "gui-x": "600"
102+ "gui-y": "300"
103+ "clearwater-homestead":
104+ charm: "cs:~thomnico/precise/clearwater-homestead"
105+ num_units: 1
106+ options:
107+ zone: clearwater.local
108+ constraints: arch=amd64
109+ expose: true
110+ annotations:
111+ "gui-x": "200"
112+ "gui-y": "300"
113+ "clearwater-sprout":
114+ charm: "cs:~thomnico/precise/clearwater-sprout"
115+ num_units: 1
116+ options:
117+ zone: clearwater.local
118+ constraints: arch=amd64
119+ expose: true
120+ annotations:
121+ "gui-x": "400"
122+ "gui-y": "600"
123+ dns:
124+ charm: "cs:~thomnico/precise/dns"
125+ num_units: 1
126+ options:
127+ domain: clearwater.local
128+ annotations:
129+ "gui-x": "1000"
130+ "gui-y": "450"
131+ "telscale-load-balancer":
132+ charm: "cs:~gvagenas-g/trusty/telscale-load-balancer-0"
133+ num_units: 1
134+ expose: true
135+ annotations:
136+ "gui-x": "-78.2210693359375"
137+ "gui-y": "412.7301025390625"
138+ mysql:
139+ charm: "cs:trusty/mysql-5"
140+ num_units: 1
141+ annotations:
142+ "gui-x": "-857.8215242215981"
143+ "gui-y": "698.5485784445332"
144+ sipml5:
145+ charm: "local:trusty/sipml5"
146+ num_units: 1
147+ expose: true
148+ annotations:
149+ "gui-x": "1383.4697265625"
150+ "gui-y": "423.10858154296875"
151+ "telscale-restcomm":
152+ charm: "cs:~gvagenas-g/trusty/telscale-restcomm-0"
153+ num_units: 1
154+ expose: true
155+ annotations:
156+ "gui-x": "-500.625244140625"
157+ "gui-y": "547.9537963867188"
158+ relations:
159+ - - "clearwater-bono:scscf"
160+ - "clearwater-sprout:pcscf"
161+ - - "clearwater-homestead:homestead-cscf"
162+ - "clearwater-sprout:homestead-hss"
163+ - - "clearwater-homer:xdms-user"
164+ - "clearwater-sprout:xdms"
165+ - - "clearwater-ellis:homestead-prov"
166+ - "clearwater-homestead:homestead-prov-user"
167+ - - "clearwater-ellis:xdms"
168+ - "clearwater-homer:xdms-user"
169+ - - "clearwater-ellis:programmable-multiple"
170+ - "dns:programmable-multiple"
171+ - - "clearwater-homer:programmable-multiple"
172+ - "dns:programmable-multiple"
173+ - - "clearwater-bono:programmable-multiple"
174+ - "dns:programmable-multiple"
175+ - - "clearwater-sprout:programmable-multiple"
176+ - "dns:programmable-multiple"
177+ - - "clearwater-homestead:programmable-multiple"
178+ - "dns:programmable-multiple"
179+ - - "sipml5:dns-client"
180+ - "dns:dns-client"
181+ - - "mysql:db"
182+ - "telscale-restcomm:database"
183+ - - "telscale-restcomm:load-balancer"
184+ - "telscale-load-balancer:load-balancer"
185+ - - "telscale-load-balancer:clearwater-ellis"
186+ - "clearwater-ellis:as-catalog"
187+ - - "telscale-restcomm:cscf"
188+ - "clearwater-sprout:as"
189+ series: trusty
190
191=== added file 'telco/integrate-with-ext-zabbix'
192--- telco/integrate-with-ext-zabbix 1970-01-01 00:00:00 +0000
193+++ telco/integrate-with-ext-zabbix 2014-10-29 15:02:22 +0000
194@@ -0,0 +1,59 @@
195+#!/bin/bash
196+#
197+# integrate with an external zabbix on a machine
198+# Copyright (C) 2014 Canonical Ltd.
199+#
200+# Authors: nicolas.thomas@canonical.com
201+#
202+# This program is free software: you can redistribute it and/or modify
203+# it under the terms of the GNU General Public License as published by
204+# the Free Software Foundation, version 3 of the License.
205+#
206+# This program is distributed in the hope that it will be useful,
207+# but WITHOUT ANY WARRANTY; without even the implied warranty of
208+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
209+# GNU General Public License for more details.
210+#
211+# You should have received a copy of the GNU General Public License
212+
213+set -ex
214+
215+VM_IP=$1
216+
217+if [[ -z "$VM_IP" ]]
218+then
219+ echo "must give name/ip of the system to configure on"
220+ exit 2
221+fi
222+
223+SSH="ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP "
224+
225+export JUJU_ENDPOINT=`juju api-endpoints`
226+export ADMIN_PASS=`cat ${JUJU_HOME:-~/.juju}/environments/$(juju switch).jenv|grep admin-secret|awk '{print $2;}'`
227+
228+
229+## Connect to zabbix to juju API
230+
231+TMP=`mktemp `
232+cat > $TMP <<EOF
233+juju-api:
234+ endpoint: "wss://$JUJU_ENDPOINT"
235+ admin-secret: $ADMIN_PASS
236+EOF
237+#echo 'juju-api:'; echo ' endpoint: "'$JUJU_ENDPOINT'"'; echo ' admin-secret: '$ADMIN_PASS > $TMP
238+
239+scp -o StrictHostKeyChecking=no $TMP ubuntu@$VM_IP:/tmp/.jujuapi.yaml
240+
241+$SSH "sudo mv /tmp/.jujuapi.yaml /usr/lib/zabbix/externalscripts/.jujuapi.yaml"
242+$SSH "sudo chown zabbix:zabbix /usr/lib/zabbix/externalscripts/.jujuapi.yaml"
243+$SSH "sudo chmod 644 /usr/lib/zabbix/externalscripts/.jujuapi.yaml"
244+
245+##usr/lib/zabbix/externalscripts/.jujuapi.yaml "
246+
247+juju deploy cs:~samuel-cozannet/precise/zabbix-agent || echo "already deployed keep going"
248+juju set zabbix-agent server-host=$VM_IP
249+
250+juju add-relation clearwater-ellis zabbix-agent || echo "already related to ellis keep going"
251+
252+echo "You can now connect Got to th gui and connect clearwater services to zabbix-agent"
253+
254
255=== modified file 'zabbix/install-on-machine'
256--- zabbix/install-on-machine 2014-10-16 15:35:39 +0000
257+++ zabbix/install-on-machine 2014-10-29 15:02:22 +0000
258@@ -28,7 +28,7 @@
259 ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP sudo apt-get update
260
261 #SSH into the instance and install git
262-ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP sudo apt-get -y install git
263+ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP sudo apt-get -y install git python-jujuclient
264
265 #Get Zabbix code from SamNCo
266 ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP "[[ -d zabbix/ ]] || git clone https://github.com/SaMnCo/ob-zabbix.git zabbix"

Subscribers

People subscribed via source and target branches