sowens-MBP:cookbooks sowen$ foodcritic ND-Webserver2012/
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/converter.rb:132:in `scan': invalid byte sequence in UTF-8 (ArgumentError)
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/converter.rb:132:in `convert_input'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/converter.rb:36:in `convert'
from /opt/chefdk/embedded/apps/foodcritic/lib/foodcritic/template.rb:13:in `extract'
from /opt/chefdk/embedded/apps/foodcritic/lib/foodcritic/api.rb:553:in `template_expressions_only'
from /opt/chefdk/embedded/apps/foodcritic/lib/foodcritic/api.rb:494:in `uncached_read_ast'
from /opt/chefdk/embedded/apps/foodcritic/lib/foodcritic/api.rb:225:in `read_ast'
from /opt/chefdk/embedded/apps/foodcritic/lib/foodcritic/api.rb:349:in `templates_included'
root@ubuntu-server-1404-x64:~# puppet module list
Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations
(at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')
/etc/puppet/modules
└── puppetlabs-stdlib (v4.6.0)
batch "download_neserv" do
code <<-EOH
SET username=#{user}
SET password=#{password}
net use "#{path}" %password% /user:%username%
:copy
copy "#{path}\\#{branch}\\#{branch}_#{version}.zip" "#{local_zip_path}"
IF ERRORLEVEL 0 goto disconnect
goto end
owershell_script "foobar Install" do
code <<-EOH
sc.exe create #{foobar} binPath= #{foobar}//foobar.exe"
EOH
action :run
# guard_interpreter :powershell_script
not_if "If (Get-Service -Name foobar -ErrorAction SilentlyContinue) { return 0 } Else { return 1 }"
end
I need to run this command The command only works if you have exactly one slash between foo and bar (Silly windows)
InstallUtil.exe /username=foo\bar
powershell_script "netSage Install" do
guard_interpreter :powershell_script
code <<-EOH
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
<?xml version="1.0"?> | |
<Cache> | |
<servers> | |
<% @couchbase_cache_servers.each do |server| %> | |
<add uri="<%= server -%>"/> | |
<% end %> | |
</servers> | |
<buckets> | |
<add name="<%= @couchbase_cache_name -%>" password="<%= @couchbase_cache_password -%>"/> |
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
# Notice how log_dir starts with the correct two slashes? | |
# By the time it is inserted into the template, one of those slashes is removed. | |
# Trying to use win_friendly_path to undo that | |
default['iis']['log_dir'] = 'F:\\LogFiles' |
There appears to be a bug where win_friendly_path doesn't change the path.
default.rb
default['iis']['log_dir'] = 'F:\\LogFiles'
recipe
::Chef::Recipe.send(:include, Windows::Helper)
Nomatter what I put in my berksfile and metadata file of cookbookB, berks can not fetch the dependencies.
I don't understand why. cookbook-b is a wrapper cookbook for cookbook-a. I've been able to make other wrapper cookbooks, but those were for all cookbooks available on the supermarket. I suspect that berks won't look on github for dependencies?
cd cookbook-b
rm Berksfile.lock
berks install
Resolving cookbook dependencies...
Fetching 'coookbook-a' from http://gitlab.example.com/foo/coookbook-a.git (at v2.0.0)
If you try and run chef against a file that was edited in notepad, it will give the following error
No resource, method, or local variable named ` ■f' for `Chef::Recipe
[2015-07-27T13:17:23-04:00] FATAL: NameError: No resource, method, or local variable named ` ■f' for `Chef::Recipe "(che
f-apply recipe)"'
PS C:\Users\sowen> chef-client --version
Chef: 12.4.1
PS C:\Users\sowen> chef-apply 'C:\Users\sowen\Desktop\foo.rb' -l debug
[2015-07-27T13:18:11-04:00] DEBUG: Building node object for spencerau14.ndlab.local