Forum: Cfengine Help
Subject: Re: Cfengine Help: INI file with multiple sections; common entries
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,22584,22639#msg-22639

Thanks, Aleksey.

1. System admin issue:    Redhat:  control addition of packages from a set of 
yum repositories, some repos remote, some local.

2. Desired end state: those RPMs to be installed from those repos.

I trust that we agree that (a) using yum to maintain RPMs is good and (b) using 
cfengine to maintain the yum configuration is good.

Yum cleanly uses a file per repo:
   remote-A.repo
   remote-B.repo
   local-P.repo
   local-Q.repo

Each file has multiple sections, in INI format.  Each "remote*" file needs a 
"proxy=" line in each of its sections.  The local files should not have such a 
line in their sections.

In cfengine I can list the remote repo files:
   vars:
     "yum_directory" string => "/etc/yum.repos.d";
     "remote_repo_files" slist => { "remote-A.repo", "remote-B.repo"};

But what should the "files:" look like, so that the "remote*" files get the 
"proxy=" line in all their sections?
  files:
    "$(yum_directory)/$(remote_repo_files)"
       ## what goes here? ##

As I say, in one sense yum is a side issue.  "cfengine" seem to lack some 
primitives for making common promises across multiple sections of an INI file.

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

Reply via email to