I'm trying to use bash to create custom facts that are booleans, Unfortunately, when I do, the values are interpreted as strings, and not booleans. For example, here is my bash script, gdm.sh:

#!/bin/bash

PATH=/usr/bin:/bin:/usr/sbin:/sbin

rpm --quiet -q gdm
retval=$?
if [ $retval -eq 0 ]; then
    echo gdm_installed=true
else
    echo gdm_installed=false
fi

When I run the script, I get output in the following format, depending on whether or not the gdm package is installed on the node:

gdm_installed=true
gdm_installed=false

From everything I've read online, that should be sufficient, but when I run 'puppet facts, I see that the values for gdm_installed are strings and not booleans. For example:

# puppet facts | grep false
    "fips_enabled": false,
    "gdm_installed": "false",
    "clientnoop": false


What am I doing wrong here? Is there something special about bash that prevents it from being used like this?

--
Prentice

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/883d5506-d9aa-8aa1-4904-89176566efac%40pppl.gov.
For more options, visit https://groups.google.com/d/optout.

Reply via email to