~smoser/ubuntu/trusty/maas/lp-1172566

« back to all changes in this revision

Viewing changes to debian/maas-cluster-controller.config

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2014-04-03 13:45:02 UTC
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20140403134502-8a6wvuqwyuekufh0
Tags: upstream-1.5+bzr2227
ImportĀ upstreamĀ versionĀ 1.5+bzr2227

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
. /usr/share/debconf/confmodule
6
 
db_version 2.0
7
 
 
8
 
# Only ask for new installations and reconfiguring.
9
 
# XXX Fix to not ask when installing from the CD.
10
 
if ([ "$1" = "configure" ] && [ -z "$2" ]); then
11
 
 
12
 
    db_get maas-cluster-controller/maas-url || true
13
 
    if [ -z "$RET" ]; then
14
 
        # Attempt to pre-populate if installing on the region controller.
15
 
        if [ -e /etc/maas/maas_local_settings.py ]; then
16
 
            url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py)
17
 
            # If the URL doesn't end in /MAAS then add it. This helps upgrades from
18
 
            # precise for which the URL didn't contain /MAAS, which is now required
19
 
            if ! echo $url | grep -qs "/MAAS$"; then
20
 
                url="${url}/MAAS"
21
 
            fi
22
 
            db_set maas-cluster-controller/maas-url "$url"
23
 
        else
24
 
            # Will only get here if dbconf value not already set, or
25
 
            # /etc/maas/maas_local_settings.py doesn't exist.
26
 
            db_input medium maas-cluster-controller/maas-url || true
27
 
            db_go
28
 
        fi
29
 
    fi
30
 
fi
31
 
 
32
 
if [ "$1" = "reconfigure" ]; then
33
 
    db_input high maas-cluster-controller/maas-url || true
34
 
    db_go
35
 
fi
36
 
#DEBHELPER#