I’m still quite new to puppet however I’m writing some deployments with it.
I came a across an issue where I couldn’t get symlinks right because for some reason I was getting a mismatch between existing system folders and puppet ${architecture} variable.
I need the following code to work as following:
On Ubuntu 12.04 x86_64 I sould get a link from /usr/lib/libz.so to /usr/lib/x86_64-linux-gnu/libz.so However, I’m getting insted to /usr/lib/amd64-linux-gnu/libz.so which doesn’t exist creating than a broken link.
file {"/usr/lib/libz.so":
ensure => link,
target => "/usr/lib/${architecture}-linux-gnu/libz.so",
}
Puppet uses Facter to get system facts, and running facter on my command line I get the following:
root@somehost:/root# facter
architecture => amd64
facterversion => 1.6.5
hardwareisa => x86_64
(....)
Running lscpu I get:
root@tsomehost:/root# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
(....)
My question is, where does Facter gets its facts from?
The Facter documentation now includes docs about how core facts are resolved.
uname -mand then on Debian convertsx86_64toamd64uname -p$hardwaremodelmight be what you want here, however I think it will return x86_64 if you used a 64-bit kernel with a 32-bit userland, which probably isn’t correct for your use-case.