[chef] Re: Re: Re: Re: Installing package on debian


Chronological Thread 
  • From: Geoff Meakin < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Installing package on debian
  • Date: Sun, 25 Mar 2012 15:38:10 +0100

Hi,

From the page you just sent -->
-y, --yes, --assume-yes
Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package or removing an essential package, occurs then apt-get will abort.

As you can see apt-get aborts and doesnt do the work on an "essential" package.


Cheers
Geoff


On 25 Mar 2012, at 14:49, Joshua Miller wrote:

The -y option should take care of that I believe.



options "--force-yes -Y"

On Mar 25, 2012, at 2:34 AM, Geoff Meakin < "> > wrote:

It still demands interactivity from STDIN that the particular phrase is typed: "Yes, do as I say!" (It's a weird apt thing for packages marked essential)

I guess I'll have to use a bash resource instead, I just wondered if package could do it to make it distro independent.

Cheers
Geoff

On 24 Mar 2012, at 21:33, Joshua Miller wrote:

You could wrap the "options" attribute in a case statement?


http://wiki.opscode.com/display/chef/Resources#Resources-Package


Install Package with options
package "debian-archive-keyring" do
  action :install
  options "--force-yes"
end

On Mar 24, 2012, at 2:13 PM, Geoff Meakin < "> > wrote:

Hi all, I am on debian

doing:

package "foo" do
 action :install
end

works fine in most cases.

Some packages however (I read somewhere there are 8 of them?) seem to be critical/core packages and trying to uninstall them mean that the normal way of installing under the covers:
 apt-get -y

just doesnt work.  upstart is such a package as it uninstalls sysvinit.

Is there a standard way of automatically installing this using chef?


If I had to do a commandline version I would do this:

yes "Yes, do as I say!" | apt-get -y --force-yes upstart

But then this deviates somewhat from the nicely distribution-agnostic package chef dsl


Thanks






Archive powered by MHonArc 2.6.16.

§