The language-puppet website.

Work with your manifests!

Quick Facts Editing With Pdbquery

I was made aware that it was not easy to play with facts for newcomers. I added a quick command to pdbquery that works like this :

1
pdbquery -t test -l /tmp/test.yaml addfacts test.site.com

This should create the file /tmp/test.yaml containing the following facts :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
facts:
  test.site.com:
    memorysize: 31.31 GB
    ipaddress: 192.168.0.1
    hostname: test
    osfamily: Debian
    lsbdistcodename: precise
    facterversion: 0.1
    fqdn: test.site.com
    memoryfree: 21.16 GB
    environment: test
    operatingsystem: Ubuntu
    domain: site.com
    lsbdistrelease: 12.04
    puppetversion: language-puppet
    virtual: xenu
    operatingsystemrelease: 12.04
    clientcert: test.site.com
    is_virtual: 'true'
    lsbdistid: Ubuntu
    mountpoints: / /data
    architecture: x86_64
    swapsize: 9.31 GB
    lsbmajdistrelease: 12
    rootrsa: xxx
    swapfree: 9.31 GB
    lsbdistdescription: Ubuntu 12.04.3 LTS
    hardwaremodel: x86_64
resources: {}

You can then edit this file to add/remove/alter facts as you want. You can then use them in the following way:

1
puppetresources -p . -o test.site.com --pdbfile /tmp/test.yaml

This only works properly in HEAD right now, and will be fixed in 0.10.3, because of this Yaml bug that just got worked around today.

Comments