~andreserl/maas/update_1.7_changelog

« back to all changes in this revision

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

  • Committer: Andres Rodriguez
  • Date: 2014-10-14 06:55:35 UTC
  • Revision ID: andreserl@ubuntu.com-20141014065535-3v2sr2ww41heino0
Manage cases where Cluster Controller is on a different place than the region and needs a shared secret

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
    fi
122
122
}
123
123
 
 
124
configure_shared_secret() {
 
125
    db_get maas-cluster-controller/shared-secret || true
 
126
    if [ -n "$RET" ]; then
 
127
        echo "$RET" | maas-provision install-shared-secret
 
128
        chown maas:maas /var/lib/maas/secret
 
129
        chmod 0640 /var/lib/maas/secret
 
130
    fi
 
131
}
124
132
 
125
133
 
126
134
if [ "$1" = "configure" ] && [ -z "$2" ]; then
135
143
 
136
144
    configure_maas_tgt
137
145
    configure_pserv_generator
 
146
    # Only ask for a shared secret when the region is not installed
 
147
    # on the same system.
 
148
    if [ -n "$DEBCONF_RECONFIGURE" ] && [ ! -f /usr/sbin/maas-region-admin ]; then
 
149
        db_input high maas-cluster-controller/shared-secret
 
150
        db_go
 
151
    fi
 
152
    configure_shared_secret
138
153
 
139
154
    # This config file may contain a private cluster UUID.  Only maas
140
155
    # can read it; only root can write it.