Skip to content

Commit

Permalink
Merge pull request #7 from arledesma/feature/log-level
Browse files Browse the repository at this point in the history
Use lowercase log-level
  • Loading branch information
brianshumate authored Mar 13, 2017
2 parents d894fcb + c58d4d3 commit f7e8283
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The role defines variables in `defaults/main.yml`:
| `vault_user` | `vault` | OS user |
| `vault_group` | `bin` | OS group |
| `vault_datacenter` | `dc1` | Datacenter label - Not impemented |
| `vault_log_level` | `INFO` | Log level |
| `vault_log_level` | `info` | [Log level](https://github.com/hashicorp/vault/blob/b1ed578f3da3263ca1973d16dcb33490125486b8/command/server.go#L1003-L1005) - Supported values: [trace, debug, info, warn, err](https://github.com/hashicorp/vault/blob/b1ed578f3da3263ca1973d16dcb33490125486b8/command/server.go#L87-L103) |
| `vault_syslog_enable` | `true` | Log to syslog - Not impemented |
| `vault_iface` | `eth1` | Network interface - Not impemented |
| `vault_address` | `{{ hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] }}` | Primary interface address |
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ vault_cluster_name: "sutakku"
vault_datacenter: "dc1"
vault_consul: "127.0.0.1:8500"
vault_consul_path: "vault"
vault_log_level: "INFO"
vault_log_level: "info"
vault_syslog_enable: "true"
vault_iface: "eth1"
vault_address: "0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ANSIBLE_PLAYBOOK = ENV['ANSIBLE_PLAYBOOK'] || "site.yml"
BOX_MEM = ENV['BOX_MEM'] || "1536"
BOX_NAME = ENV['BOX_NAME'] || "debian/jessie64"
VAULT_HOSTS = ENV['VAULT_HOSTS'] || "vagrant_hosts"
LOGLEVEL = ENV['VAULT_LOGLEVEL'] || "INFO"
LOGLEVEL = ENV['VAULT_LOGLEVEL'] || "info"
VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion templates/vault_debian.init.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DESC="Vault secret management tool"
NAME=vault
DAEMON="{{ vault_bin_path }}/$NAME"
PIDFILE=/var/run/$NAME/$NAME.pid
DAEMON_ARGS="server -config={{ vault_main_config }} -log-level={{ vault_log_level }}"
DAEMON_ARGS="server -config={{ vault_main_config }} {% if vault_log_level is defined %}-log-level={{ vault_log_level | lower }}{% endif %}"
USER={{ vault_user }}
SCRIPTNAME=/etc/init.d/$NAME

Expand Down
3 changes: 2 additions & 1 deletion templates/vault_systemd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ After=basic.target network.target
User={{ vault_user }}
Group={{ vault_group }}
PIDFile=/var/run/vault/vault.pid
ExecStart={{ vault_bin_path }}/vault server -config={{ vault_main_config }} -log-level={{ vault_log_level }}
ExecStart="{{ vault_bin_path }}/vault" server -config={{ vault_main_config }} {% if vault_log_level is defined %}-log-level={{ vault_log_level | lower }}
{% endif %}
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
Expand Down
2 changes: 1 addition & 1 deletion templates/vault_sysvinit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ start() {
[ -f $PID_FILE ] && rm $PID_FILE
daemon --user={{ vault_user }} \
--pidfile="$PID_FILE" \
"$VAULT" server -config={{ vault_main_config }} -log-level={{ vault_log_level }} &
"$VAULT" server -config={{ vault_main_config }} {% if vault_log_level is defined %}-log-level={{ vault_log_level | lower }}{% endif %} &
retcode=$?
touch /var/lock/subsys/vault
return $retcode
Expand Down

0 comments on commit f7e8283

Please sign in to comment.