~rogpeppe/juju-core/041-config-agent-version

« back to all changes in this revision

Viewing changes to environs/cloudinit/cloudinit.go

  • Committer: Roger Peppe
  • Date: 2012-08-30 12:25:49 UTC
  • mfrom: (443.1.7 juju-core)
  • Revision ID: roger.peppe@canonical.com-20120830122549-jmn0ledsyj1uxhd2
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        // Provisioner specifies whether the new machine will run a provisioning agent.
27
27
        Provisioner bool
28
28
 
29
 
        // ZooKeeper specifies whether the new machine will run a zookeeper instance.
30
 
        ZooKeeper bool
 
29
        // StateServer specifies whether the new machine will run a ZooKeeper 
 
30
        // or MongoDB instance.
 
31
        StateServer bool
31
32
 
32
33
        // InstanceIdAccessor holds bash code that evaluates to the current instance id.
33
34
        InstanceIdAccessor string
89
90
 
90
91
        c.AddSSHAuthorizedKeys(cfg.AuthorizedKeys)
91
92
        c.AddPackage("libzookeeper-mt2")
92
 
        if cfg.ZooKeeper {
 
93
        if cfg.StateServer {
 
94
                // TODO(dfc) remove these once we cut over to mstate
93
95
                c.AddPackage("default-jre-headless")
94
96
                c.AddPackage("zookeeper")
95
97
                c.AddPackage("zookeeperd")
 
98
 
 
99
                // mongodb
 
100
                c.AddPackage("mongodb-server")
96
101
        }
97
102
 
98
103
        addScripts(c,
118
123
                debugFlag = " --debug"
119
124
        }
120
125
 
121
 
        // zookeeper scripts
122
 
        if cfg.ZooKeeper {
 
126
        if cfg.StateServer {
 
127
                // zookeeper scripts
123
128
                addScripts(c,
124
129
                        cfg.jujuTools()+"/jujud bootstrap-state"+
125
130
                                " --instance-id "+cfg.InstanceIdAccessor+
185
190
 
186
191
func (cfg *MachineConfig) zookeeperHostAddrs() string {
187
192
        var hosts []string
188
 
        if cfg.ZooKeeper {
 
193
        if cfg.StateServer {
189
194
                hosts = append(hosts, "localhost"+zkPortSuffix)
190
195
        }
191
196
        if cfg.StateInfo != nil {
214
219
        if cfg.Tools.URL == "" {
215
220
                return requiresError("tools URL")
216
221
        }
217
 
        if cfg.ZooKeeper {
 
222
        if cfg.StateServer {
218
223
                if cfg.InstanceIdAccessor == "" {
219
224
                        return requiresError("instance id accessor")
220
225
                }