Last active
April 14, 2017 13:06
-
-
Save mickfeech/1a39962a808d829a3889a9db49bb33d6 to your computer and use it in GitHub Desktop.
Chef 13 vs 12 IP address differences
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
# cookbooks/example/Berksfile | |
source 'https://supermarket.chef.io' | |
metadata | |
cookbook 'hashivault', git: 'http://gitrepo.local/hashivault.git' #location of custom resource cookbook |
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
Installing Chef... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 20507 100 20507 0 0 75611 0 --:--:-- --:--:-- --:--:-- 75671 | |
el 7 x86_64 | |
Getting information for chef stable 12.19.36 for el... | |
downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=12.19.36&p=el&pv=7&m=x86_64 | |
to file /tmp/install.sh.62/metadata.txt | |
trying curl... | |
sha1 5e36301f5e751f2a79a8b513831b5bc0b478bbed | |
sha256 124d34d3a26ce25305899bc93df58aaf4979c5c065adcf1e6487734afb6edf6c | |
url https://packages.chef.io/files/stable/chef/12.19.36/el/7/chef-12.19.36-1.el7.x86_64.rpm | |
version 12.19.36 | |
downloaded metadata file looks valid... | |
downloading https://packages.chef.io/files/stable/chef/12.19.36/el/7/chef-12.19.36-1.el7.x86_64.rpm | |
to file /tmp/install.sh.62/chef-12.19.36-1.el7.x86_64.rpm | |
trying curl... | |
Comparing checksum with sha256sum... | |
Installing chef 12.19.36 | |
installing with rpm... | |
warning: /tmp/install.sh.62/chef-12.19.36-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY | |
Preparing... ######################################## | |
Updating / installing... | |
chef-12.19.36-1.el7 ######################################## | |
Thank you for installing Chef! | |
Creating directory: /tmp/packer-chef-solo | |
Creating directory: /tmp/packer-chef-solo/cookbooks-0 | |
Creating configuration file 'solo.rb' | |
Creating JSON attribute file | |
Executing Chef: cd /tmp/packer-chef-solo/cookbooks-0 && tar zxf *.gz -C ./ --strip 1 && chef-solo --no-color -c /tmp/packer-chef-solo/solo.rb -j /tmp/packer-chef-solo/node.json | |
[2017-04-14T13:00:51+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support. | |
[2017-04-14T13:00:52+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /tmp/packer-chef-solo | |
One version per cookbook | |
[2017-04-14T13:00:52+00:00] INFO: Forking chef instance to converge... | |
[2017-04-14T13:00:52+00:00] INFO: *** Chef 12.19.36 *** | |
[2017-04-14T13:00:52+00:00] INFO: Platform: x86_64-linux | |
[2017-04-14T13:00:52+00:00] INFO: Chef-client pid: 190 | |
[2017-04-14T13:00:54+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/packer-docker-build | |
[2017-04-14T13:00:54+00:00] INFO: Setting the run_list to ["recipe[example::default]"] from CLI options | |
[2017-04-14T13:00:54+00:00] INFO: Run List is [recipe[example::default]] | |
[2017-04-14T13:00:54+00:00] INFO: Run List expands to [example::default] | |
[2017-04-14T13:00:54+00:00] INFO: Starting Chef Run for packer-docker-build | |
[2017-04-14T13:00:54+00:00] INFO: Running start handlers | |
[2017-04-14T13:00:54+00:00] INFO: Start handlers complete. | |
[2017-04-14T13:00:54+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: | |
[2017-04-14T13:00:54+00:00] INFO: Loading cookbooks [example@0.1.0, hashivault@0.1.0] | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/Berksfile in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/chef-12.json in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/Berksfile.lock in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/chef-13.json in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/resources/secret.rb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/recipes/default.rb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/files/default/set-env.sh in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/templates/default/server.hcl.erb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/recipes/default.rb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/recipes/vault.rb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/templates/default/supervisord.conf.erb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/metadata.json in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/chefignore in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/files/default/run.sh in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/Gemfile in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/filter_junit.awk in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/attributes/default.rb in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/metadata.json in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/packer.json in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/example/.gitlab-ci.yml in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/Jenkinsfile in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/README.md in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Storing updated cookbooks/hashivault/.gitlab-ci.yml in the cache. | |
[2017-04-14T13:00:54+00:00] INFO: Processing chef_gem[vault] action install (hashivault::default line 1) | |
[2017-04-14T13:00:56+00:00] INFO: chef_gem[vault] installed vault at 0.9.0 | |
[2017-04-14T13:00:56+00:00] INFO: Processing chef_gem[vault] action install (hashivault::default line 1) | |
[2017-04-14T13:00:56+00:00] INFO: Processing vault_secret[secret/org/web] action read (example::default line 2) | |
[2017-04-14T13:00:56+00:00] INFO: Chef Run complete in 1.813786154 seconds | |
[2017-04-14T13:00:56+00:00] INFO: Running report handlers | |
[2017-04-14T13:00:56+00:00] INFO: Report handlers complete |
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
Installing Chef... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 20507 100 20507 0 0 70181 0 --:--:-- --:--:-- --:--:-- 71702 | |
el 7 x86_64 | |
Getting information for chef stable for el... | |
downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=&p=el&pv=7&m=x86_64 | |
to file /tmp/install.sh.59/metadata.txt | |
trying curl... | |
sha1 f0eac57e53833d710334839fbe4e9b940d1c43c6 | |
sha256 a3cb30fe2eb6e3ce5ea8914635d01562660f4978568fa3303b14336eefdb09ee | |
url https://packages.chef.io/files/stable/chef/13.0.118/el/7/chef-13.0.118-1.el7.x86_64.rpm | |
version 13.0.118 | |
downloaded metadata file looks valid... | |
downloading https://packages.chef.io/files/stable/chef/13.0.118/el/7/chef-13.0.118-1.el7.x86_64.rpm | |
to file /tmp/install.sh.59/chef-13.0.118-1.el7.x86_64.rpm | |
trying curl... | |
Comparing checksum with sha256sum... | |
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | |
You are installing an omnibus package without a version pin. If you are installing | |
on production servers via an automated process this is DANGEROUS and you will | |
be upgraded without warning on new releases, even to new major releases. | |
Letting the version float is only appropriate in desktop, test, development or | |
CI/CD environments. | |
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | |
Installing chef | |
installing with rpm... | |
warning: /tmp/install.sh.59/chef-13.0.118-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY | |
Preparing... ######################################## | |
Updating / installing... | |
chef-13.0.118-1.el7 ######################################## | |
Thank you for installing Chef! | |
Creating directory: /tmp/packer-chef-solo | |
Creating directory: /tmp/packer-chef-solo/cookbooks-0 | |
Creating configuration file 'solo.rb' | |
Creating JSON attribute file | |
Executing Chef: cd /tmp/packer-chef-solo/cookbooks-0 && tar zxf *.gz -C ./ --strip 1 && chef-solo --no-color -c /tmp/packer-chef-solo/solo.rb -j /tmp/packer-chef-solo/node.json | |
[2017-04-14T13:02:12+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support. | |
Starting Chef Client, version 13.0.118 | |
resolving cookbooks for run list: ["example::default"] | |
Synchronizing Cookbooks: | |
- example (0.1.0) | |
- hashivault (0.1.0) | |
Installing Cookbook Gems: | |
Compiling Cookbooks... | |
Recipe: hashivault::default | |
* chef_gem[vault] action install | |
- install version 0.9.0 of package vault | |
Converging 2 resources | |
* chef_gem[vault] action install (up to date) | |
Recipe: example::default | |
* vault_secret[secret/org/web] action read | |
================================================================================ | |
Error executing action `read` on resource 'vault_secret[secret/org/web]' | |
================================================================================ | |
IPAddr::InvalidAddressError | |
--------------------------- | |
invalid address | |
Cookbook Trace: | |
--------------- | |
/tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/hashivault/resources/secret.rb:11:in `block in class_from_file' | |
Resource Declaration: | |
--------------------- | |
# In /tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/example/recipes/default.rb | |
2: vault_secret 'secret/org/web' | |
Compiled Resource: | |
------------------ | |
# Declared in /tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/example/recipes/default.rb:2:in `from_file' | |
vault_secret("secret/org/web") do | |
action [:read] | |
default_guard_interpreter :default | |
declared_type :vault_secret | |
cookbook_name "example" | |
recipe_name "default" | |
path "secret/org/web" | |
end | |
System Info: | |
------------ | |
chef_version=13.0.118 | |
platform=redhat | |
platform_version=7.3 | |
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] | |
program_name=chef-solo worker: ppid=181;start=13:02:13; | |
executable=/opt/chef/bin/chef-solo | |
Running handlers: | |
[2017-04-14T13:02:16+00:00] ERROR: Running exception handlers | |
Running handlers complete | |
[2017-04-14T13:02:16+00:00] ERROR: Exception handlers complete | |
Chef Client failed. 1 resources updated in 02 seconds | |
[2017-04-14T13:02:16+00:00] FATAL: Stacktrace dumped to /tmp/packer-chef-solo/local-mode-cache/cache/chef-stacktrace.out | |
[2017-04-14T13:02:16+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report | |
[2017-04-14T13:02:16+00:00] ERROR: vault_secret[secret/org/web] (example::default line 2) had an error: IPAddr::InvalidAddressError: invalid address | |
[2017-04-14T13:02:16+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) |
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
# cookbooks/hashivault/recipes/default.rb | |
chef_gem 'vault' do | |
compile_time true | |
end | |
require 'vault' |
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
# cookbooks/example/attributes/default.rb | |
default['vault_address'] = 'http://hashivault-vault.localhost' #location of vault endpoint | |
default['vault_token'] = '00000000-0000-0000-0000-000000000000' #vault token |
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
# cookbooks/example/recipes/default.rb | |
include_recipe 'hashivault::default' | |
vault_secret 'secret/org/web' |
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
# cookbooks/example/metadata.rb | |
name 'example' | |
maintainer 'mickfeech' | |
maintainer_email 'cmcfee@kent.edu' | |
license 'all_rights' | |
description 'Example' | |
long_description 'example' | |
version '0.1.0' | |
depends 'hashivault' |
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
# cookbooks/resources/secret.rb | |
resource_name :vault_secret | |
default_action :read | |
property :path, String, name_property: true | |
property :destination | |
action :read do | |
Vault.address = node['vault_address'] | |
Vault.token = node['vault_token'] | |
destination ||= path | |
secret = Vault.logical.read(path) | |
if secret.nil? | |
raise "Could not read secret `#{path}'!" | |
end | |
updated_by_last_action(true) | |
node.run_state[destination] = secret | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment