Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] That wasn't the problem, but I did screw something up. Anyway, it's fixed now. I will paste the relevant parts. This bundle is kinda huge so I'll leave out the irrelevant parts.
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] https://pastebin.com/TsHxFvBp
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] Here is the relevant section of def.json that the template should populate from: https://pastebin.com/EYmM67x6
    Sameroom
    @sameroom-bot
    [Nick Anderson, Northern.tech] If you do not provide data used to render a template then datastate() is used.
    [Nick Anderson, Northern.tech] datastate() includes the defined classes.
    [Nick Anderson, Northern.tech] If you prepare a data container for use with a template and you want to also use classes in the template, you need to get the classes into the data structure.
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] Ok, I don't think I've ever seen that explained in the docs anywhere. So, I'm glad I asked. Thanks, I'll give this a shot.
    [Jeff Carlson, irc.libera.chat] `"_c" data => "@{_s[classes]}";` <-- this wouldn't work?
    Sameroom
    @sameroom-bot
    [@nickanderson:matrix.org, irc.libera.chat] If you do that then class will I think be at the top level, not under a classes key. So in the template you would drop the 'classes.' prefix I believe.
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] I can't seem to print out the datastate(). This didn't work:
    [Jeff Carlson, irc.libera.chat] "FINALLY: ${with}" with => format("%S", datastate());
    Sameroom
    @sameroom-bot
    [Craig Comstock, Northern.tech] depending on how you want it… you could do "datastate is ${with}" with => storejson(datastate()); but that’s quite a lot of info :o
    [Jeff Carlson, irc.libera.chat] I just want to see everything right now.
    [Craig Comstock, Northern.tech] yeah, that should work, it’ll be formatted better than format() would give you as well.
    [Craig Comstock, Northern.tech] I use storejson a lot in reports, with with :)
    [Jeff Carlson, irc.libera.chat] All I get back is this:
    [Jeff Carlson, irc.libera.chat] R: FINALLY: ${with}
    [Craig Comstock, Northern.tech] hmm.
    [Jeff Carlson, irc.libera.chat] "FINALLY: ${with}" with => storejson(datastate());
    [Jeff Carlson, irc.libera.chat] It's like I have no datastate().
    [Craig Comstock, Northern.tech] yeah.
    [Craig Comstock, Northern.tech] cf-agent -V ?
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] CFEngine Core 3.18.0
    [Jeff Carlson, irc.libera.chat] Downloaded community version for CentOS 7.
    [Jeff Carlson, irc.libera.chat] Because it's CentOS 7.
    [Craig Comstock, Northern.tech] this is what I have:
    bundle agent main { reports: "datastate is ${with}" with => storejson(datastate()); }
    [Craig Comstock, Northern.tech] not sure how that showed in your IRC, but I suspect your example is more complicated. Are you using a namespace by any chance?
    [Craig Comstock, Northern.tech] that’s the only thing I can think of, as to why you get nothing.
    [Jeff Carlson, irc.libera.chat] No known use of namespace here. And it displays in IRC as multiple lines in the preformatting that you applied which Slack makes pretty for you. Basically, I see the triple-backticks.
    [Craig Comstock, Northern.tech] right. so not terrible but not awesome. good enough ;)
    [Craig Comstock, Northern.tech] if you run that simple policy file does it work with a big pile of json, top-level keys being classes and vars?
    [Jeff Carlson, irc.libera.chat] When I use backticks, does it render for you or do you see the backticks? Like `this`?
    Sameroom
    @sameroom-bot
    [Craig Comstock, Northern.tech] I see the nice way… slack formats it as grey background, red letters, courier font.
    [Craig Comstock, Northern.tech] so no backticks.
    [Jeff Carlson, irc.libera.chat] Cool.
    [Jeff Carlson, irc.libera.chat] I ran your example, I got a big ol' dump of data.
    [Jeff Carlson, irc.libera.chat] I'm just going to copy that into my bundle.
    [Craig Comstock, Northern.tech] right on.
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] Have a look at this. https://pastebin.com/eD4AGeX6
    [Craig Comstock, Northern.tech] interesting, so many duplicate lines there and no datastate out :(
    [Craig Comstock, Northern.tech] if you just want to see the final result you can add some args to cf-agent like --show-evaluated-vars and --show-evaluated-classes
    Sameroom
    @sameroom-bot
    [Jeff Carlson, irc.libera.chat] Oh man, infinite scrollback is infinite....
    [Craig Comstock, Northern.tech] ;) well… i mean… infinite… that’s a pretty big amount, “to the beginning”?
    [Craig Comstock, Northern.tech] where do you have infinite scrollback?
    [Jeff Carlson, irc.libera.chat] In my terminal. Terminator in this case.
    [Jeff Carlson, irc.libera.chat] It's just that it dumped the full text of my entire promise library at one point. It was a lot and it was unformatted.
    [Jeff Carlson, irc.libera.chat] Or at least it looked like the full text. As I said, it was unformatted so I think that's what it was.
    [Jeff Carlson, irc.libera.chat] Which apparently included stdlib as well as my own stuff.
    Sameroom
    @sameroom-bot
    [Craig Comstock, Northern.tech] well it’s closing time for me about now. have a good weekend and be well!