rylarson / chef-cygwin Goto Github PK
View Code? Open in Web Editor NEWChef cookbook to install and configure cygwin
License: Apache License 2.0
Chef cookbook to install and configure cygwin
License: Apache License 2.0
Possible corrupt mirror? Setup.ini rejected.
unattended_mode is set at mbox: returning default value
mbox note: Unable to get setup from <http://mirrors.kernel.org/sourceware/cygwin/>
unattended_mode is set at mbox: returning default value
download/verify error in unattended_mode: out of retries
note: Installation incomplete. Check C:\cygwin\var\log\setup.log.full for details
Ending cygwin install
STDERR:
---- End output of setup.exe -q -O -R C:/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ ----
Ran setup.exe -q -O -R C:/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ returned 1
Resource Declaration:
---------------------
# In C:\Users\vagrant\AppData\Local\Temp\kitchen\cookbooks\cygwin\recipes\default.rb
28: execute "setup.exe" do
29: cwd node['cygwin']['download_path']
30: command "setup.exe -q -O -R #{node['cygwin']['home']} -s #{node['cygwin']['site']} #{proxy_command}"
31: not_if { File.exists?("C:/cygwin/etc/passwd") }
32: end
33:
Compiled Resource:
------------------
# Declared in C:\Users\vagrant\AppData\Local\Temp\kitchen\cookbooks\cygwin\recipes\default.rb:28:in `from_file'
execute("setup.exe") do
action [:run]
retries 0
retry_delay 2
default_guard_interpreter :execute
command "setup.exe -q -O -R C:/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ "
backup 5
cwd "C:\\Users\\vagrant\\AppData\\Local\\Temp\\kitchen\\cache"
returns 0
declared_type :execute
cookbook_name :cygwin
recipe_name "default"
not_if { #code block }
end
I was able to get it to converge by modifying your default recipe and changing the install command
execute "setup.exe" do
cwd node['cygwin']['download_path']
command "setup.exe -q -O -R #{node['cygwin']['home']} --no-desktop --download --local-install -s #{node['cygwin']['site']} #{proxy_command}"
not_if { File.exists?("C:/cygwin/etc/passwd") }
end
The not_if guards in providers/package.rb
are incorrect. The clause is being evaluated as a string, not being executed. This results in the not_if guard always returning false, which causes the package in question to be reinstalled every time Chef is run. I believe the lines should look something like:
not_if { `#{node['cygwin']['home']}/bin/cygcheck -c #{new_resource.name}"`.include? "OK" }
It's standard to define proxies in chef config in URL form. Cygwin doesn't like that. The fix below to the single line of code solves the issue and retains backward compatibility.
module Cygwin
module Helpers
def proxy_command
Chef::Config['http_proxy'].nil? ? "" : "--proxy #{Chef::Config['http_proxy'].gsub('http://', '')}"
end
end
end
To make this cookbook work with windows_firewall 3.0.0, simply use the default protocol or specify protocol 'TCP'
windows_firewall_rule 'ssh' do
localport '22'
protocol :TCP
firewall_action :allow
end
to:
windows_firewall_rule 'ssh' do
localport '22'
firewall_action :allow
end
I am running into the following problem when I try to run this cookbook:
get_url_to_membuf http://mirrors.kernel.org/sourceware/cygwin/x86_64/setup.ini.sig
getUrlToStream http://mirrors.kernel.org/sourceware/cygwin/x86_64/setup.ini.sig
getUrlToStream failed!
get_url_to_membuf failed!
mbox note: Unable to get setup.ini from <http://mirrors.kernel.org/sourceware/cygwin/>
unattended_mode is set at mbox: returning default value
download/verify error in unattended_mode: out of retries
note: Installation incomplete. Check C:\cygwin\var\log\setup.log.full for details
Ending cygwin install
STDERR:
---- End output of setup.exe -q -O -R C:/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ --proxy http://proxy.aus
tin.hp.com:8080 ----
Ran setup.exe -q -O -R C:/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ --proxy http://proxy.austin.hp.com:8080
returned 1
Does anyone know how to resovle this?
The not_if guard in the default recipe checks for the existence of C:/cygwin/etc/passwd
to see if running setup.exe can be skipped. Newer versions of Cygwin do not write /etc/passwd
, and instead use native Windows credentials. Because /etc/passwd
no longer exists, Cygwin setup runs every time the cookbook is executed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.