Passing data in bundle

thierry thunot <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Hi all i need help about this promise.
I have been looking for many hours why my promise does not work. I want in 
my report that all nom_clef_brute values ​​are displayed in the report for 
each entry of the variable parametrage_des_sources. only one is display... 

bundle agent __main__ 
{ 
       vars: 

       "parametrage_des_sources" data => '{ 
                               "mogodb" : { 
                                               "nom_de_la_liste"     : 
"mogodb.list", 
                                               "nom_clef_brute"     : 
"GPG-KEY-mongodb.gpg.key", 
                                               "url_repo"           : 
"http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" 
                                                 }, 
                                "elasticsearch" : { 
                                               "nom_de_la_liste"     : 
"elasticsearch.list", 
                                               "nom_de_la_clef"     : 
"GPG-KEY-elasticsearch.gpg.key", 
                                               "url_repo"           : 
"https://artifacts.elastic.co/packages/oss-7.x/apt stable main" 
                                                }, 
                                
                                       "graylog" : { 
                                               "nom_de_la_liste"     : 
"graylog.list", 
                                               "nom_de_la_clef"     : 
"graylog-keyring.gpg.key", 
                                               "url_repo"           : 
"https://packages.graylog2.org/repo/debian/ stable 4.2", 
                                       } 
                                               }'; 

       methods: 
               "" usebundle => donnees(storejson(parametrage_des_sources)); 
               #"" usebundle => donnees($(parametrage_des_sources)); 

} 

bundle agent donnees(valeurs) 
{ 
 vars: 
   "donnees_extraites" data => parsejson($(valeurs)); 
   "nom" slist => getindices($(valeurs)); 
#"decompo" data => readjson ($(valeurs)); 

 reports: 
 "Nom des datas $(nom)"; 
  "Nom_de_la_liste pour l'entre '$(nom)' est  $(donnees_extraites[$(nom)
][nom_clef_brute])";

}

The result of this promises :

root@cfeginetest:/var/cfengine/masterfiles# cf-agent -Kf 
./essais_bundle_parametrique.cf R: Nom des datas elasticsearch 
R: Nom des datas graylog 
R: Nom des datas mogodb 
R: Nom_de_la_liste pour l'entre 'mogodb' est  GPG-KEY-mongodb.gpg.key


 why cf stop loop at the first data? where are the result for  elasticsearch 
and 
mogodb.

i need to use this array to create debian source definition files 
automatically
exemple : 
/etc/apt/sources.list.d/mogodb.list
content: 
deb [signed-by=/etc/apt/trusted.gpg.d/GPG-KEY-mongodb.gpg.key] 
http://repo.mongodb.org/apt/debianbuster/mongodb-org/4.2 main 

Thank for your help

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/b80e644b-9393-4232-9322-78c2a53240b3n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.