diff --git a/README.md b/README.md index f754d785..b1cd35df 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/defaults/main.yml b/defaults/main.yml index 4c105f76..663d770d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" diff --git a/examples/Vagrantfile b/examples/Vagrantfile index 2805000a..da31df4a 100644 --- a/examples/Vagrantfile +++ b/examples/Vagrantfile @@ -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" diff --git a/templates/vault_debian.init.j2 b/templates/vault_debian.init.j2 index 0b3bfcfe..1b0eb741 100644 --- a/templates/vault_debian.init.j2 +++ b/templates/vault_debian.init.j2 @@ -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 diff --git a/templates/vault_systemd.service.j2 b/templates/vault_systemd.service.j2 index 2def3e3a..86d66241 100644 --- a/templates/vault_systemd.service.j2 +++ b/templates/vault_systemd.service.j2 @@ -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 diff --git a/templates/vault_sysvinit.j2 b/templates/vault_sysvinit.j2 index 01949654..643bb55b 100644 --- a/templates/vault_sysvinit.j2 +++ b/templates/vault_sysvinit.j2 @@ -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