-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support storing configuration of uchiwa settings inside data bag
- Loading branch information
1 parent
b6bb093
commit 80510e5
Showing
10 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Explicitly declare text files you want to always be normalized and converted | ||
# to native line endings on checkout. | ||
#*.c text | ||
#*.h text | ||
encrypted_data_bag_secret text eol=lf | ||
|
||
# Declare files that will always have CRLF line endings on checkout. | ||
#*.sln text eol=crlf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
#*.png binary | ||
#*.jpg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Uchiwa | ||
module Helpers | ||
|
||
def self.data_bag_item(data_bag_name, data_bag_item, missing_ok=false) | ||
|
||
Chef::EncryptedDataBagItem.load(data_bag_name, data_bag_item).to_hash.delete_if { |key, value| key == 'id' } | ||
|
||
rescue Chef::Exceptions::ValidationFailed, | ||
Chef::Exceptions::InvalidDataBagPath, | ||
Net::HTTPServerException => error | ||
missing_ok ? nil : raise(error) | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Randomly generated encryption key. | ||
Created with the following command | ||
openssl rand -base64 512 -out test/fixtures/encrypted_data_bag_secret | ||
|
||
Purpose: Use encrypted data bags in kitchen tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"settings": { | ||
"encrypted_data": "X38NtwomNjMc0TZ69e9F3liakDtQcoQa1G9ckgG4YOkyAnPlh1KKUTSmL82i\nmgVuhodC5CkqpL9YJLQdP27cVZCtrCFQPE5FArnNvykZ7/zbdHmivu9UVHUb\nuwX5awAweVRL86trjgf2mS+zgJyZpR/h4vTcupYk6Uu8HhGxRDM=\n", | ||
"iv": "5Ls8fW9duziCa4nRbsBLgw==\n", | ||
"version": 1, | ||
"cipher": "aes-256-cbc" | ||
}, | ||
"api": { | ||
"encrypted_data": "WK9Qw2QWiUzf9mfWIRB9hDp9Mxx/dvpUqqvrF65tNyQMp7djdIAgM7ugDYv4\n5WWfNp1wYWLRXqM61sicV5/yEiHSaT+J/pvH0uD6+yQtR/PpAChoLYzabxSu\n5WrGZP1RhPjIvOH+5oYTMZMOCgXuWIpQywhbaL1Qo/Gx9VH3L06p7x3NWD7B\nxZ4yLjFzPWf2A1abgO5X39s8lv39vZhpWIt6PNiDuIYZxmyRsr+KsLwizCDv\n3rCsgm+O3z4n3oZ8AT3RY3s7WGsisu32Ab8MtA==\n", | ||
"iv": "vvy3UhWFpV4VgwLMHAwDOA==\n", | ||
"version": 1, | ||
"cipher": "aes-256-cbc" | ||
}, | ||
"id": "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
VwD9kqvyXtFeuGwP+SQ5+k5DdUyGl4+pdfhgkstbtJF9yNAW1YW18h1XZQ7Yz2Lw | ||
7K+9gAGwXGJFnjrssgOU2RbACyrYHp5cM2t33vegj3IqBems1nrVyL10q4t4qwY3 | ||
IjSgIliR2Qc7gt5rZ/YzMRf8ydXvB/Qx6Ks4DQNVa56o6sjeauI9voVYAKXbZLpG | ||
tyyDd08Qezy4yoX9XONWK8OQPzmgKTtDCGOBnpmH8C+vLp8CjsKDMey6k0Om+4a/ | ||
W4d2G4jiAI6fn5l/7TuNwylOBVUzrOdhthlVyDCvvKkms63Bki7pPLFNklZ7YFdd | ||
wC++DZ/v+n/3JOC+/RuS1oOXOI/26/bzo9aQZAy+pJkKT2/Z2eoWzH8BLWNS3E3s | ||
T0snaZISMJZmC6s3vkTVJLiIWzQFqyrozRxhrpZ6mKGBicNuq0QuKasTKmFjaWf7 | ||
PROnR6QuYILvHhL37JEtcXSeYPPgKiVlLhc21Dqs2uHv0i4H+I7XuBAIOD7vzlxy | ||
06u2LqDZzq281mkZP+vIKTs57L8M/0kF6P0HsOyTa0SM9t52h2hrROATe6anjL4i | ||
9jLIsPPRvlTBab40w7gPKJvygLO+XPDJmC+9OPcC4QwypZ+DCimkNhOYJVTPKnCr | ||
aKjWfmxEgPD6LWvVgGpfStG5MMVRgVkXMmCF/B+LfaI= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"settings": { | ||
"users": [ | ||
{ | ||
"username": "kitchen_user", | ||
"password": "kitchen_password", | ||
"role": { | ||
"readonly": false | ||
} | ||
} | ||
] | ||
}, | ||
"api": [ | ||
{ | ||
"name": "sensu_kitchen1", | ||
"host": "api1.example.com", | ||
"port": 4567, | ||
"ssl": false, | ||
"timeout": 5000 | ||
}, | ||
{ | ||
"name": "sensu_kitchen2", | ||
"host": "api2.example.com", | ||
"port": 4567, | ||
"ssl": false, | ||
"timeout": 5000 | ||
} | ||
], | ||
"id": "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters