vault/command
Sean Chittenden c0bbeba5ad Teach Vault how to register with Consul
Vault will now register itself with Consul.  The active node can be found using `active.vault.service.consul`.  All standby vaults are available via `standby.vault.service.consul`.  All unsealed vaults are considered healthy and available via `vault.service.consul`.  Change in status and registration is event driven and should happen at the speed of a write to Consul (~network RTT + ~1x fsync(2)).

Healthy/active:

```
curl -X GET 'http://127.0.0.1:8500/v1/health/service/vault?pretty' && echo;
[
    {
        "Node": {
            "Node": "vm1",
            "Address": "127.0.0.1",
            "TaggedAddresses": {
                "wan": "127.0.0.1"
            },
            "CreateIndex": 3,
            "ModifyIndex": 20
        },
        "Service": {
            "ID": "vault:127.0.0.1:8200",
            "Service": "vault",
            "Tags": [
                "active"
            ],
            "Address": "127.0.0.1",
            "Port": 8200,
            "EnableTagOverride": false,
            "CreateIndex": 17,
            "ModifyIndex": 20
        },
        "Checks": [
            {
                "Node": "vm1",
                "CheckID": "serfHealth",
                "Name": "Serf Health Status",
                "Status": "passing",
                "Notes": "",
                "Output": "Agent alive and reachable",
                "ServiceID": "",
                "ServiceName": "",
                "CreateIndex": 3,
                "ModifyIndex": 3
            },
            {
                "Node": "vm1",
                "CheckID": "vault-sealed-check",
                "Name": "Vault Sealed Status",
                "Status": "passing",
                "Notes": "Vault service is healthy when Vault is in an unsealed status and can become an active Vault server",
                "Output": "",
                "ServiceID": "vault:127.0.0.1:8200",
                "ServiceName": "vault",
                "CreateIndex": 19,
                "ModifyIndex": 19
            }
        ]
    }
]
```

Healthy/standby:

```
[snip]
        "Service": {
            "ID": "vault:127.0.0.2:8200",
            "Service": "vault",
            "Tags": [
                "standby"
            ],
            "Address": "127.0.0.2",
            "Port": 8200,
            "EnableTagOverride": false,
            "CreateIndex": 17,
            "ModifyIndex": 20
        },
        "Checks": [
            {
                "Node": "vm2",
                "CheckID": "serfHealth",
                "Name": "Serf Health Status",
                "Status": "passing",
                "Notes": "",
                "Output": "Agent alive and reachable",
                "ServiceID": "",
                "ServiceName": "",
                "CreateIndex": 3,
                "ModifyIndex": 3
            },
            {
                "Node": "vm2",
                "CheckID": "vault-sealed-check",
                "Name": "Vault Sealed Status",
                "Status": "passing",
                "Notes": "Vault service is healthy when Vault is in an unsealed status and can become an active Vault server",
                "Output": "",
                "ServiceID": "vault:127.0.0.2:8200",
                "ServiceName": "vault",
                "CreateIndex": 19,
                "ModifyIndex": 19
            }
        ]
    }
]
```

Sealed:

```
        "Checks": [
            {
                "Node": "vm2",
                "CheckID": "serfHealth",
                "Name": "Serf Health Status",
                "Status": "passing",
                "Notes": "",
                "Output": "Agent alive and reachable",
                "ServiceID": "",
                "ServiceName": "",
                "CreateIndex": 3,
                "ModifyIndex": 3
            },
            {
                "Node": "vm2",
                "CheckID": "vault-sealed-check",
                "Name": "Vault Sealed Status",
                "Status": "critical",
                "Notes": "Vault service is healthy when Vault is in an unsealed status and can become an active Vault server",
                "Output": "Vault Sealed",
                "ServiceID": "vault:127.0.0.2:8200",
                "ServiceName": "vault",
                "CreateIndex": 19,
                "ModifyIndex": 38
            }
        ]
```
2016-04-25 18:01:13 -07:00
..
server Comment nits 2016-04-25 18:00:54 -07:00
test-fixtures Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
token Make TokenHelper an interface and split exisiting functionality 2015-12-22 10:23:30 -05:00
audit_disable.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
audit_disable_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
audit_enable.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
audit_enable_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
audit_list.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
audit_list_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
auth.go Merge pull request #1326 from hashicorp/sethvargo/hint_noreauth 2016-04-25 15:43:55 -04:00
auth_disable.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
auth_disable_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
auth_enable.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
auth_enable_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
auth_test.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
capabilities.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
capabilities_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
command_test.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
config.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
config_test.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
delete.go Provide clarity for output statements of idempotent calls. 2016-04-14 15:46:45 +00:00
delete_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
format.go AccessorID --> Accessor, accessor_id --> accessor 2016-03-09 06:23:31 -05:00
format_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
generate-root.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
generate-root_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
init.go Add seal tests and update generate-root and others to handle dualseal. 2016-04-25 19:39:04 +00:00
init_test.go Add check against seal type to catch errors before we attempt to use the data 2016-04-15 18:16:48 -04:00
key_status.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
key_status_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
list.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
list_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
mount.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
mount_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
mounts.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
mounts_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
mounttune.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
path_help.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
path_help_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
pgp_test.go Add the ability to generate root tokens via unseal keys. 2016-01-19 18:28:10 -05:00
policy_delete.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
policy_delete_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
policy_list.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
policy_list_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
policy_write.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
policy_write_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
read.go Fix panic when using -field with read or write with a non-string value. 2016-04-07 22:16:33 +00:00
read_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
rekey.go SealInterface 2016-04-04 10:44:22 -04:00
rekey_test.go SealInterface 2016-04-04 10:44:22 -04:00
remount.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
remount_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
renew.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
renew_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
revoke.go Provide clarity for output statements of idempotent calls. 2016-04-14 15:46:45 +00:00
revoke_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
rotate.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
rotate_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
seal.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
seal_test.go Change seal test name in command package 2016-04-26 00:12:14 +00:00
server.go Teach Vault how to register with Consul 2016-04-25 18:01:13 -07:00
server_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
ssh.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
ssh_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
status.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
status_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
step-down.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
token_create.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
token_create_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
token_lookup.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
token_lookup_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
token_renew.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
token_renew_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
token_revoke.go Provide clarity for output statements of idempotent calls. 2016-04-14 15:46:45 +00:00
token_revoke_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
unmount.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
unmount_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
unseal.go Fix up the meta common options text function to not strip leading space and fix up commands 2016-04-01 16:50:12 -04:00
unseal_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00
util.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
version.go Print version on startup. 2015-11-09 13:52:55 -05:00
version_test.go command: version test 2015-03-03 23:14:54 -08:00
write.go Fix panic when using -field with read or write with a non-string value. 2016-04-07 22:16:33 +00:00
write_test.go Move meta into its own package 2016-04-01 13:16:05 -04:00