Score:0

Is it possible to store custom runner output to pillar data in SALTSTACK?

cn flag

I have a Salt formula that runs on my minions, and it runs a custom module that reaches out to the web for some JSON data for the latest version of chrome. It works great, but I thought it would be better to run it as a runner on the master and store it as pillar data for the minions to access. That way I don't have hundreds of minions querying the web unnecessarily vs just once on the master.

I'm not finding anything helpful online. Is it even possible?

def latest():

    import json
    import urllib.request

    url = 'https://omahaproxy.appspot.com/all.json'
    resp = urllib.request.urlopen(url)

    data = json.loads(resp.read())

    for each in data:
        if each.get("os") == "win":
            versions = each.get("versions")
            for version in versions:
                if version.get("channel") == "stable":
                    latest = (version.get("current_version"))
    return latest

I can run it as is in /etc/salt/_modules, as well as a runner in /etc/salt/_runners on the master.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.