Skip to content

Instantly share code, notes, and snippets.

@filler
Last active August 29, 2015 14:25
Show Gist options
  • Save filler/512d66dfa6ad665cd65d to your computer and use it in GitHub Desktop.
Save filler/512d66dfa6ad665cd65d to your computer and use it in GitHub Desktop.
default['zabbix']['user_databag']['enabled'] = false
default['zabbix']['user_databag']['name'] = 'credentials'
default['zabbix']['user_databag']['item'] = 'zabbix'
default['zabbix']['user_databag']['secret'] = '/etc/chef/secret'
if node['zabbix']['user_databag']['enabled']
zabbix_secret = Chef::EncryptedDataBagItem.load_secret(
node['zabbix']['user_databag']['secret']
)
zabbix_creds = Chef::EncryptedDataBagItem.load(
node['zabbix']['user_databag']['name'],
node['zabbix']['user_databag']['item'],
zabbix_secret
)
username = zabbix_creds['username']
password = zabbix_creds['password']
else
username = node['zabbix']['username']
password = node['zabbix']['password']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment