"Unsupported osfamily: Linux" when trying to install Apache using Puppet

MasterRoot24 asked:

I’m trying to setup a simple Puppet setup on AWS EC2 using the latest Amazon Linux AMI.

I’ve followed through the install guide for RHEL and have a puppetmasterd daemon running.

When apply the following manifest in /etc/puppet/manifests/site.pp:

node 'ip-172-31-1-239.eu-west-1.compute.internal' {
  class { 'apache': }

I get the error:

[ec2-user@ip-172-31-1-239 ~]$ sudo puppet agent --test
info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Class['apache::version']: Unsupported osfamily: Linux at /etc/puppet/modules/apache/manifests/version.pp:37 on node ip-172-31-1-239.eu-west-1.compute.internal
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

From version.pp of the Apache module for Puppet I can see why the manifest is failing to install Apache, but I can’t understand why Facter is reporting the osfamily as “Linux” in the first place:

[ec2-user@ip-172-31-1-239 ~]$ facter | grep osfamily
osfamily => Linux

[ec2-user@ip-172-31-1-239 ~]$ rpm -qa | grep facter

[ec2-user@ip-172-31-1-239 ~]$ rpm -qa | grep puppet

[ec2-user@ip-172-31-1-239 ~]$ sudo puppet module list
├── puppetlabs-apache (v1.4.0)
├── puppetlabs-concat (v1.2.0)
└── puppetlabs-stdlib (v4.5.1)
/usr/share/puppet/modules (no modules installed)

Anyone any ideas how I can resolve this?

My answer:

Don’t use Amazon Linux. The Puppet Labs Apache module is not compatible with Amazon Linux. You will need to use one of the distributions which it is compatible with, or create your own Puppet module.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.