Forum: CFEngine Help
Subject: Re: Timing classes
Author: toddnni
Link to topic: https://cfengine.com/forum/read.php?3,22772,22782#msg-22782

Neil, thanks for inspiring ideas. 

Currently I have bundles like this

body common control {

  bundlesequence => {
    "install_packages",
    "configure_services",
    "check_services",
  };
}

bundle agent install_packages {

methods:
  configure_ssh::
    "install_sshd" 
      usebundle => verify_package("sshd"),
      action => if_elapsed("240");
  # etc.
}

bundle agent configure_services {

methods:
  configure_ssh::
    "configure_sshd" 
      usebundle => configure_sshd,
      action => if_elapsed("240");
  # etc.
}

bundle agent check_services {

methods:
  configure_ssh::
    "check_sshd"
      usebundle => verify_service("sshd"),
      action => if_elapsed("240");
  # etc.
}

and each of these three bundles contains service related promises. I thought 
that this could be made more manageable by timing classes.

However now I think that I will have structure like this

body common control {

  bundlesequence => {
    "configure_services",
  };
}

bundle agent configure_services {

methods:
  configure_ssh::
    "sshd" 
      usebundle => service_sshd,
      action => if_elapsed("240");
  # etc.
}

bundle agent service_sshd {

methods:
  any::
    "install_sshd" 
      usebundle => verify_package("sshd");
    "configure_sshd" 
      usebundle => configure_sshd;
    "check_sshd"
      usebundle => verify_service("sshd");
}


Maybe there are some drawbacks compared to my previous implementation. For 
example if some bundles need a same package to be installed, the new 
implementation will check the package many times. But I think that package 
promises are quite efficient?

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

Reply via email to