diff --git a/drivers/amazonec2/amazonec2.go b/drivers/amazonec2/amazonec2.go index cbb6cf84c8..43f68abe80 100644 --- a/drivers/amazonec2/amazonec2.go +++ b/drivers/amazonec2/amazonec2.go @@ -273,6 +273,8 @@ func (d *Driver) Create() error { return err } + log.Info("Configuring Machine...") + log.Debug("Settings tags for instance") tags := map[string]string{ "Name": d.MachineName, @@ -594,6 +596,8 @@ func (d *Driver) configureSecurityGroup(groupName string) error { d.SecurityGroupId = securityGroup.GroupId + // configure swarm permission if needed + log.Debugf("configuring security group authorization for %s", ipRange) perms := configureSecurityGroupPermissions(securityGroup) diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index 72507caa88..cf3903cdd8 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -11,7 +11,6 @@ import ( log "github.com/Sirupsen/logrus" "github.com/codegangsta/cli" "github.com/digitalocean/godo" - // "github.com/docker/docker/utils" "github.com/docker/machine/drivers" "github.com/docker/machine/ssh" "github.com/docker/machine/state" @@ -156,6 +155,8 @@ func (d *Driver) Create() error { return err } + log.Info("Configuring Machine...") + log.Debugf("Setting hostname: %s", d.MachineName) cmd, err := d.GetSSHCommand(fmt.Sprintf( "echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname", diff --git a/drivers/google/compute_util.go b/drivers/google/compute_util.go index 5c583c68a9..0f0cecfb8b 100644 --- a/drivers/google/compute_util.go +++ b/drivers/google/compute_util.go @@ -196,6 +196,8 @@ func (c *ComputeUtil) createInstance(d *Driver) error { return err } + log.Info("Configuring Machine...") + log.Debugf("Setting hostname: %s", d.MachineName) cmd, err := d.GetSSHCommand(fmt.Sprintf( "echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname", diff --git a/drivers/openstack/client.go b/drivers/openstack/client.go index 4329aa5206..7a5581fa69 100644 --- a/drivers/openstack/client.go +++ b/drivers/openstack/client.go @@ -62,7 +62,7 @@ func (c *GenericClient) CreateInstance(d *Driver) (string, error) { log.WithFields(log.Fields{ "Name": d.MachineName, - }).Info("Creating server...") + }).Info("Creating machine...") server, err := servers.Create(c.Compute, keypairs.CreateOptsExt{ serverOpts, diff --git a/drivers/vmwarevcloudair/vcloudair.go b/drivers/vmwarevcloudair/vcloudair.go index 999630bdb7..d83b31b21c 100644 --- a/drivers/vmwarevcloudair/vcloudair.go +++ b/drivers/vmwarevcloudair/vcloudair.go @@ -390,6 +390,8 @@ func (d *Driver) Create() error { return err } + log.Info("Configuring Machine...") + log.Debugf("Setting hostname: %s", d.MachineName) cmd, err := d.GetSSHCommand(fmt.Sprintf( "echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname", diff --git a/host.go b/host.go index fdcc4d2cb0..b808f94dcb 100644 --- a/host.go +++ b/host.go @@ -161,10 +161,7 @@ func (h *Host) ConfigureSwarm(discovery string, master bool, host string, addr s if err := cmd.Run(); err != nil { return err } - // TODO: - // - configure swarm to start / autostart - // - configure node to join cluster - // - configure node to run with IP of machine and URL to Docker + return nil } diff --git a/store.go b/store.go index 51445e2274..dc76f69ed3 100644 --- a/store.go +++ b/store.go @@ -69,7 +69,7 @@ func (s *Store) Create(name string, driverName string, flags drivers.DriverOptio } if flags.Bool("swarm") { - log.Info("Configuring Swarm") + log.Info("Configuring Swarm...") discovery := flags.String("swarm-discovery") master := flags.Bool("swarm-master") diff --git a/store_test.go b/store_test.go index eaacb2e1a5..c3493fcff5 100644 --- a/store_test.go +++ b/store_test.go @@ -36,7 +36,9 @@ func TestStoreCreate(t *testing.T) { flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": "unix:///var/run/docker.sock", + "url": "unix:///var/run/docker.sock", + "swarm-master-ip": "", + "swarm": false, }, } @@ -62,7 +64,9 @@ func TestStoreRemove(t *testing.T) { flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": "unix:///var/run/docker.sock", + "url": "unix:///var/run/docker.sock", + "swarm-master-ip": "", + "swarm": false, }, } @@ -91,7 +95,9 @@ func TestStoreList(t *testing.T) { flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": "unix:///var/run/docker.sock", + "url": "unix:///var/run/docker.sock", + "swarm-master-ip": "", + "swarm": false, }, } @@ -116,7 +122,9 @@ func TestStoreExists(t *testing.T) { flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": "unix:///var/run/docker.sock", + "url": "unix:///var/run/docker.sock", + "swarm-master-ip": "", + "swarm": false, }, } @@ -146,7 +154,9 @@ func TestStoreLoad(t *testing.T) { expectedURL := "unix:///foo/baz" flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": expectedURL, + "url": expectedURL, + "swarm-master-ip": "", + "swarm": false, }, } @@ -177,7 +187,9 @@ func TestStoreGetSetActive(t *testing.T) { flags := &DriverOptionsMock{ Data: map[string]interface{}{ - "url": "unix:///var/run/docker.sock", + "url": "unix:///var/run/docker.sock", + "swarm-master-ip": "", + "swarm": false, }, } diff --git a/utils/certs.go b/utils/certs.go index 70b8a6cde9..76c1bce2a3 100644 --- a/utils/certs.go +++ b/utils/certs.go @@ -93,9 +93,10 @@ func GenerateCert(hosts []string, certFile, keyFile, caFile, caKeyFile, org stri } // client if len(hosts) == 1 && hosts[0] == "" { - template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth} + template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth} template.KeyUsage = x509.KeyUsageDigitalSignature } else { // server + template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth} for _, h := range hosts { if ip := net.ParseIP(h); ip != nil { template.IPAddresses = append(template.IPAddresses, ip)