From 67fab4951aeeae5af52d0f31688cc14efab33d2d Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 13 Mar 2022 14:08:14 +0900 Subject: [PATCH] Retrieve hostname. --- cookbooks/vault/attributes.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cookbooks/vault/attributes.rb b/cookbooks/vault/attributes.rb index eb30f07..60e15a6 100644 --- a/cookbooks/vault/attributes.rb +++ b/cookbooks/vault/attributes.rb @@ -14,9 +14,12 @@ else end ipaddr = run_command(cmd).stdout.chomp +hostname = run_command('uname -n').stdout.chomp + node.reverse_merge!({ 'vault' => { 'manager' => false, 'ipaddr' => ipaddr, + 'hostname' => hostname, } })