blob: c92c49de51007d27275f6fbbf98accfb9d1a9dba [file] [log] [blame]
Matteo Scandoloede125b2017-08-08 13:05:25 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Scott Bakerc41914d2017-06-26 14:00:52 -070017---
18- hosts: cmi
19 connection: ssh
20 user: root
21 vars:
22 eth_device: eth0
23 eth_mac: 02:42:CF:8D:C0:82
24 cmi_password: XOScdn123$
25 cmi_hostname: xos-cloudlab-cmi-vtn.opencloud.us
26 cmi_dns: 8.8.8.8
27 cdn_site: CoBlitz Test
28 cdn_short_name: cobtest
29 cdn_name: CoBlitz
30# gateway_ip: 10.124.0.1
31# gateway_mac: 00:8c:fa:5b:09:d8
32 gateway_ip: 207.141.192.129
33 gateway_mac: a4:23:05:45:56:79
34 node_hostname: xos-cloudlab-node1-vtn.opencloud.us
35 tasks:
36 - name: fix the networking
37 shell: "{{ item }}"
38 with_items:
39 - ifconfig {{ eth_device }} hw ether {{ eth_mac }}
40 - ip route del default || true
41 - ip route add default via {{ gateway_ip }}
42 - arp -s {{ gateway_ip }} {{ gateway_mac }}
43
44 - name: copy over setup answers
45 template: src=templates/setup_answers.txt dest=/root/setup_answers.txt
46
47 - name: run the setup script
48 shell: /a/sbin/setup.sh < /root/setup_answers.txt
49 args:
50 creates: /a/var/log/setup.log
51
52 - name: fix onevapi CDNPrefix bug
53 shell: sed -i 's/hostname/str/g' /vservers/coplc/usr/share/cob_api/COB/PublicObjects/CDNPrefix.py
54
55 - name: fix onevapi OriginServer bug
56 shell: sed -i 's/attrToCheck = "edge_hosttype"/attrToCheck = "edge_hosttype_broken"/g' /vservers/coplc/usr/share/cob_api/COB/PublicObjects/OriginServer.py
57
58 - name: copy over cmi setup template
59 template: src=templates/setup_cmi_onevsh.sh dest=/vservers/coplc/root/setup_cmi_onevsh.sh
60
61 - name: run cmi setup script
62 command: vserver coplc exec onevsh /root/setup_cmi_onevsh.sh
63
64 - name: copy over cmi node setup template
65 template: src=templates/setup_cmi_node.sh dest=/vservers/coplc/root/setup_cmi_node.sh
66
67 - name: run node setup script
68 command: vserver coplc exec plcsh /root/setup_cmi_node.sh
69 args:
70 creates: /vservers/coplc/root/takeover-{{ node_hostname }}
71
72 - name: retrieve node takeover script
73 fetch: src=/vservers/coplc/root/takeover-{{ node_hostname }} dest=takeovers/takeover-{{ node_hostname }}
74
75 - name: update all keys script
76 copy: src=private/allkeys.template dest=/vservers/coplc/etc/onevantage/services/HPC/templates/usr/local/CoBlitz/var/allkeys.template
77
78 - name: install keygen
79 copy: src=private/keygen dest=/vservers/coplc/etc/onevantage/services/HPC/templates/usr/local/CoBlitz/var/keygen mode=0755
80
81 - name: download socat
82 get_url: url=http://pkgs.repoforge.org/socat/socat-1.7.2.1-1.el6.rf.x86_64.rpm dest=/root/socat-1.7.2.1-1.el6.rf.x86_64.rpm
83
84 - name: install socat
85 yum: name=/root/socat-1.7.2.1-1.el6.rf.x86_64.rpm state=present