~hp-moonshot/ubuntu/trusty/hp-moonshot/hp-proliant

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Narinder Gupta
  • Date: 2014-09-04 20:37:03 UTC
  • Revision ID: narinder.gupta@canonical.com-20140904203703-2sk67uwbzk9fc4tk
branch a new version for HP proliant systems where there is no power management required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
set -e
4
4
set -x
5
5
 
6
 
PKG="hp-moonshot"
 
6
PKG="hp-proliant"
7
7
RETRY=120
8
8
 
9
9
#Get network information for MAAS internal network.
10
 
if [ -f /etc/hp-moonshot.conf ]; then
11
 
        PREFIX=$(awk -F '[:]' NR==1'{print $3"."$4}' /etc/hp-moonshot.conf)
 
10
if [ -f /etc/hp-proliant.conf ]; then
 
11
        PREFIX=$(awk -F '[:]' NR==1'{print $3"."$4}' /etc/hp-proliant.conf)
12
12
else
13
13
        PREFIX="10.14"
14
14
fi
44
44
        fi
45
45
fi
46
46
 
47
 
. /usr/lib/hp-moonshot/inc/common
 
47
. /usr/lib/hp-proliant/inc/common
48
48
 
49
49
setup_maas_admin() {
50
50
        # Configure the MAAS admin user
70
70
        maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=${PREFIX}.100.1 ip_range_high=${PREFIX}.199.254 management=2 broadcast_ip=${PREFIX}.255.255 router_ip=${PREFIX}.4.1
71
71
        # Setup nat
72
72
        # Ensure we can ping out to maas.ubuntu.com
73
 
        hp-moonshot-setup-nat $internal_interface $external_interface
 
73
        hp-proliant-setup-nat $internal_interface $external_interface
74
74
        # Redirect to MAAS web interface
75
75
        cat >/var/www/html/index.html <<EOF
76
76
<meta http-equiv="refresh" content="0; url=/MAAS">
100
100
                maas admin maas set-config name=http_proxy value=$HTTP_PROXY
101
101
        else
102
102
                # This is now a transparent proxy
103
 
                sed -i 's/10.14/${PREFIX}/g' /usr/lib/hp-moonshot/inc/squid.conf
104
 
                cat /usr/lib/hp-moonshot/inc/squid.conf > /etc/squid3/squid.conf
 
103
                sed -i 's/10.14/${PREFIX}/g' /usr/lib/hp-proliant/inc/squid.conf
 
104
                cat /usr/lib/hp-proliant/inc/squid.conf > /etc/squid3/squid.conf
105
105
                invoke-rc.d squid3 restart
106
106
        fi
107
107
}
140
140
        # make sure we can get out to the internet
141
141
        maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
142
142
        if dpkg --compare-versions $maas_ver lt 1.6; then
143
 
                cat /usr/lib/hp-moonshot/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
 
143
                cat /usr/lib/hp-proliant/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
144
144
        else
145
 
                cat /usr/lib/hp-moonshot/inc/bootresources_1.6.yaml > /etc/maas/bootresources.yaml
 
145
                cat /usr/lib/hp-proliant/inc/bootresources_1.6.yaml > /etc/maas/bootresources.yaml
146
146
        fi
147
147
 
148
148
        if [ -n "$HTTP_PROXY" ]; then
273
273
        # Ensure that pxe and dhcp are running
274
274
        ensure_running_maas
275
275
        maas admin node-groups import-boot-images
276
 
        hp-moonshot-add-virtual-nodes
277
 
        hp-moonshot-add-physical-nodes
 
276
        hp-proliant-add-virtual-nodes
278
277
}
279
278
 
280
279
apply_patches() {
299
298
}
300
299
 
301
300
commission_and_bootstrap(){
302
 
        hp-moonshot-maas-init
 
301
        hp-proliant-maas-init
303
302
}
304
303
 
305
304
case "$1" in
328
327
                        echo
329
328
                        echo "INFO: Skipping adding all nodes, since this is a package upgrade"
330
329
                        echo "INFO: If you want to delete and add all nodes again, run:"
331
 
                        echo "INFO:   sudo hp-moonshot-add-virtual-nodes"
332
 
                        echo "INFO:   sudo hp-moonshot-add-physical-nodes"
 
330
                        echo "INFO:   sudo hp-proliant-add-virtual-nodes"
 
331
                        echo "INFO:   sudo hp-proliant-add-physical-nodes"
333
332
                        echo
334
333
                else
335
334
                        # Only add all nodes on initial install, not upgrades