Using a Chef to Install Window Applications

I saw several examples of installing windowed applications using the Chef Git resource. I have two questions:

What is the best practice for installing window applications that are not available in Git and there are no existing cookbooks in the chef community?

eg. download and install windows installer hosted by @ static url? I suppose I could just put it in the Git repository and pull it out, but I wonder if there is a more elegant way to pull it directly from the providers website, similar to wget?

How to start the Windows bootloader after boot and provide the parameters requested during the installation procedure? for example, that on Windows there is no compilation equivalent: run, "bash [compile_app_name]" and how to include the parameters required by the installation utility (install the directory, etc.) in the chef's recipe?

+3
source share
3 answers

These are definitely β€œbest practices,” but I hacked my way through here . It mainly uses a windows cookbook . Basically, I read basic documents about Windows resources and ran chef-client / solo again and again.

+1
source

Windows windows_package LWRP. , , URL-. , . , . , . , .

(1) ( )

def download_from_ftp package 
  ftp_info = data_bag_item(node.chef_environment, 'ftp-credentials')['credentials']['ftp']

  ftp_file_path="/#{package}"
  target = "#{node['downloads']}/#{package}" 

  remote_file "#{target}" do
    source "ftp://#{ftp_info['user']}:#{ftp_info['password']}@#{ftp_info['host']}/#{ftp_file_path}"
    action :create_if_missing
  end

  target
end

(2) : install

    action :install do
        package = "#{new_resource.name}_#{new_resource.build}.exe" 

        location = download_from_ftp(package)

        execute "install #{new_resource.name}" do
          command "call #{location} #{dir} /sp /verysilent /suppressmsgboxes"
        end
    end

, .

+3

Windows, , , , , . chocolatey coobook.

0

All Articles