Merge lp://staging/~rogpeppe/juju-core/151-cloudinit-root-cert into lp://staging/~juju/juju-core/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~rogpeppe/juju-core/151-cloudinit-root-cert |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
124 lines (+40/-2) 3 files modified
environs/cloudinit/cloudinit.go (+15/-1) environs/cloudinit/cloudinit_test.go (+24/-0) environs/ec2/ec2.go (+1/-1) |
To merge this branch: | bzr merge lp://staging/~rogpeppe/juju-core/151-cloudinit-root-cert |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+134498@code.staging.launchpad.net |
Description of the change
environs/cloudinit: add RootCertPEM
Instances need to know the root CA certificate
so that they can verify the server they're talking to.
Unmerged revisions
- 724. By Roger Peppe
-
gofmt
- 723. By Roger Peppe
-
environs/ec2: add fake root cert to MachineConfig
- 722. By Roger Peppe
-
environs/cloudinit: add RootCertPEM field
- 721. By Roger Peppe
-
cmd/juju: reenable bootstrap tests.
Looks like I forgot to add a call to gocheck.Suite
in revision 669. Oops.R=niemeyer
CC=
https://codereview. appspot. com/6848052 - 720. By Roger Peppe
-
environs: add a certificate argument to Bootstrap
R=dfc, niemeyer, TheMue
CC=
https://codereview. appspot. com/6819115 - 719. By Roger Peppe
-
environs/cloudinit: add cert/private key
First stage in enabling TLS.
R=dfc, TheMue, niemeyer
CC=
https://codereview. appspot. com/6811095 - 718. By Dave Cheney
-
Add README
R=fwereade, aram
CC=
https://codereview. appspot. com/6816114 - 717. By Dave Cheney
-
Add CONTRIBUTING
R=fwereade, niemeyer, aram
CC=
https://codereview. appspot. com/6817113 - 716. By William Reade
-
uniter_test: snappier waitUniterDead
waitUniterDead was on occasion waiting almost the full 5 seconds before the
uniter happened to notice it was ready to die. We now repeatedly sync state
while waiting, in order to ensure timely detection of state changes on the
uniter side. On this machine, this change speeds up the uniter suite by
roughly 20%. - 715. By Roger Peppe
-
environs/jujutest: further refinement
We change to use attributes rather than config.Config.
This enables us to have configuration values drawn from an environment
set up for the test, for instance from a faked-up home directory.R=fwereade, TheMue
CC=
https://codereview. appspot. com/6851043
Reviewers: mp+134498_ code.launchpad. net,
Message:
Please take a look.
Description:
environs/cloudinit: add RootCertPEM
Instances need to know the root CA certificate
so that they can verify the server they're talking to.
https:/ /code.launchpad .net/~rogpeppe/ juju-core/ 151-cloudinit- root-cert/ +merge/ 134498
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6854054/
Affected files: cloudinit/ cloudinit. go cloudinit/ cloudinit_ test.go
A [revision details]
M environs/
M environs/
M environs/ec2/ec2.go
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: environs/ cloudinit/ cloudinit. go cloudinit/ cloudinit. go' cloudinit/ cloudinit. go 2012-11-14 14:09:56 +0000 cloudinit/ cloudinit. go 2012-11-15 16:11:30 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -29,6 +29,10 @@
// or MongoDB instance.
StateServer bool
+ // RootCertPEM holds the x509 certificate of the root CA StdEncoding. EncodeToString( data)
+ // that signed the state server certificate, in PEM format.
+ RootCertPEM []byte
+
// StateServerPEM holds the state server certificate and private
// key in PEM format; it is required when StateServer is set,
// and ignored otherwise.
@@ -85,7 +89,10 @@
return base64.
}
-const serverPEMPath = "/var/lib/ juju/server. pem" juju/server. pem" juju/root. pem"
+const (
+ serverPEMPath = "/var/lib/
+ rootCertPEMPath = "/var/lib/
+)
func New(cfg *MachineConfig) (*cloudinit.Config, error) {
if err := verifyConfig(cfg); err != nil {
@@ -115,6 +122,10 @@
debugFlag = " --debug"
}
+ addScripts(c, string( cfg.RootCertPEM )), Sprintf( "echo %s > %s", RootCertPEM) == 0 { ccessor == "" {
+ fmt.Sprintf("echo %s > %s", shquote(
rootCertPEMPath),
+ )
+
if cfg.StateServer {
addScripts(c,
fmt.
@@ -280,6 +291,9 @@
if cfg.StateInfo == nil {
return fmt.Errorf("missing state info")
}
+ if len(cfg.
+ return fmt.Errorf("missing root CA certificate PEM")
+ }
if cfg.StateServer {
if cfg.InstanceIdA
return fmt.Errorf("missing instance id accessor")
Index: environs/ cloudinit/ cloudinit_ test.go cloudinit/ cloudinit_ test.go' cloudinit/ cloudinit_ test.go 2012-11-14 14:09:56 +0000 cloudinit/ cloudinit_ test.go 2012-11-15 16:11:30 +0000 "1.2.3- linux-amd64" ), "1.2.3- linux-amd64" ), "state- addr.example. com"}, MachineCo. ..
=== modified file 'environs/
--- environs/
+++ environs/
@@ -44,6 +44,7 @@
Tools: newSimpleTools(
StateServer: true,
StateServerPEM: serverPEM,
+ RootCertPEM: rootCertPEM,
StateInfo: &state.Info{
Password: "arble",
},
@@ -56,6 +57,7 @@
AuthorizedKeys: "sshkey1",
DataDir: "/var/lib/juju",
StateServer: false,
+ RootCertPEM: rootCertPEM,
Tools: newSimpleTools(
StateInfo: &state.Info{
Addrs: []string{
@@ -260,6 +262,13 @@
{"missing state server PEM", func(cfg *cloudinit.