Forum: Cfengine Help
Subject: Re: Package installation - trouble specifying environment variable
Author: ticketo
Link to topic: https://cfengine.com/forum/read.php?3,21587,21639#msg-21639


Have you tried using environment in agent control?
It would seem that this could be appropriately
set here.


Thank you for the hint. At least it works now.


body agent control {
  debian::
    # debconf should never ask question while installing
    # doing so would require user interaction to answer them!
    environment => {
      "DEBIAN_FRONTEND='noninteractive'"
    };
}


I'm just not convinced this is the 'perfect' solution. Why? Everyone using the 
standard library must remember to set this value or else package installation 
may break some point in time. So it would be nice, if either the standard 
library would already take care of this by itself or if this is not possible at 
least warn the user, that some additionnal configuration is necessary. 

Maybe some comment like 


##

# Please remember to set the environment variable DEBIAN_FRONTEND to
# 'noninteractive' in body agent control or otherwise assure that debconf is not
# run during package installation
body package_method apt
{
[...]

body package_method generic
{
[...]
  # Please remember to set the environment variable DEBIAN_FRONTEND to
  # 'noninteractive' in body agent control or otherwise assure that debconf is 
not
  # run during package installation
  debian::


would be helpful.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to