Score:0

regex puppet query syntax

sc flag

I'm trying to learn how to use puppet query, but I'm finding it difficult to target a particular fact path using regex.

If I use the following query, I get exactly what I'm looking for:

puppet-query 'inventory[certname, facts.os.family, facts.mountpoints./nfs/systems.filesystem] { facts.os.family = "RedHat" and facts.os.release.major <= "6" and facts.mountpoints./nfs/systems.filesystem = "nfs" }'

  {
    "certname": "SERVER1",
    "facts.os.family": "RedHat",
    "facts.mountpoints./nfs/systems.filesystem": "nfs"
  },
  {
    "certname": "SERVER2",
    "facts.os.family": "RedHat",
    "facts.mountpoints./nfs/systems.filesystem": "nfs"
  },
  {
    "certname": "SERVER3",
    "facts.os.family": "RedHat",
    "facts.mountpoints./nfs/systems.filesystem": "nfs"
  }
]

However, not every server is going to use the precise mount path '/nfs/systems'.

Therefore I tried to use regex instead:

puppet-query 'inventory[certname, facts.os.family, facts.mountpoints.(.*).filesystem] { facts.os.family = "RedHat" and facts.os.release.major <= "6" and facts.mountpoints(.*).filesystem = "nfs" }'

puppet doesn't complain about the syntax, but it returns nothing.

What is wrong with my syntax?

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.