ripienaar
04/11/2024, 11:05 AMzipkid
04/11/2024, 11:05 AMStefan Buchberger
04/23/2024, 11:06 AMmcollective::site_policies
. I want to match same hosts by regular expression and I have tried to use Complex Compound or Select Queries
in hiera
. I want to filter nodes using the `fqdn`fact (or networking.fqdn
) and match the following hosts host-1.test
, host-2.test
and host-3.test
. I have tried to use the following but it does not work:
mcollective::site_policies:
- action: "allow"
callers: "choria=testuser.mcollective"
actions: "*"
facts: "with('fqdn=/^host[1-3].test/')"
classes: "*"
Also, it appears to be that using `networking.fqdn`is not working and only the legacy `fqdn`fact is. What would be the correct way to achieve my goal?ripienaar
04/23/2024, 11:09 AMripienaar
04/23/2024, 11:09 AMripienaar
04/23/2024, 11:10 AMfqdn=~/^host/
might workStefan Buchberger
04/23/2024, 11:16 AMfqdn=~/^host/
but it does not work sadduck. Do you have any other idea how I could make this work.ripienaar
04/23/2024, 11:21 AM{
"one": "one",
"two": "two two",
"three": "three three three",
"digit": 1,
"boolean": false,
"nested": {
"facts": "value"
}
}
this works for me
pol.facts = "nested.facts=~/^al/"
matched, err = pol.MatchesFacts(cfg, logger)
Expect(err).ToNot(HaveOccurred())
Expect(matched).To(BeFalse())
pol.facts = "nested.facts=~/^val/"
matched, err = pol.MatchesFacts(cfg, logger)
Expect(err).ToNot(HaveOccurred())
Expect(matched).To(BeTrue())
ripienaar
04/23/2024, 11:21 AMripienaar
04/23/2024, 11:21 AMStefan Buchberger
04/23/2024, 11:48 AMripienaar
04/23/2024, 11:49 AMchoria inventory some.f.q.d.n
to see what facts it knows aboutStefan Buchberger
04/23/2024, 11:51 AMripienaar
04/23/2024, 11:51 AMchoria find -F fqdn=~/^host[1-3].test/
finds just these machines?Stefan Buchberger
04/23/2024, 11:52 AMfacts: "networking.fqdn=host1.test
it does not work, while facts: fqdn=host1.test
doesStefan Buchberger
04/24/2024, 2:10 PMripienaar
04/24/2024, 2:12 PMripienaar
04/24/2024, 2:12 PMripienaar
04/24/2024, 2:12 PMStefan Buchberger
04/24/2024, 2:13 PMrpcauthorization = 1
was changed to 0
while updating in /etc/choria/choria-shim.cfg
ripienaar
04/24/2024, 2:13 PMripienaar
04/24/2024, 2:13 PMStefan Buchberger
04/24/2024, 2:13 PMripienaar
04/24/2024, 2:13 PMStefan Buchberger
04/24/2024, 2:17 PMStefan Buchberger
04/24/2024, 2:17 PMStefan Buchberger
04/24/2024, 2:37 PMStefan Buchberger
04/24/2024, 2:37 PM0
, I can also use `networking.fqdn`which did not work either beforeripienaar
04/24/2024, 2:46 PMripienaar
04/24/2024, 2:46 PM