Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alias.pp to let users of Amazon Linux use the module #545

Merged
merged 1 commit into from
Jan 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion manifests/mod/alias.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class apache::mod::alias {
$icons_path = $::osfamily ? {
$icons_path = $::osfamily or $::operatingsystem ? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa! This works?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to http://docs.puppetlabs.com/puppet/latest/reference/lang_conditional.html#control-variables "You cannot use expressions as control variables."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. That's fine if you don't do it this way, but you need to add support for Amazon Linux since it's becoming a significant distribution in the cloud whatever the proper way is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://gist.github.com/casharma/cd40b7ed82c7fd9b4659 Doesn't seem to indicate that. What version of puppet are you using?

Also, Amazon Linux is osfamily RedHat since facter 1.7.0 (10 months old) specifically to avoid having to add a bunch of these to modules. What version of facter are you using?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically you are correct it's built off RHEL, but they are not working like a RHEL/CentOS system. Every single Forge package I've tried to use that has used osfamily = redhat or operatingsystem = Centos does not work (or at least didn't). Is it possible at some point something changed in the Amazon Linux AMI that broke Facter or Facter had a bug? Just a few weeks back operatingsystem was = to Linux on Amazon Linux.

[root@puppet ~]# facter operatingsystem
Amazon
[root@puppet ~]# facter osfamily
RedHat
[root@puppet ~]# cat /etc/system-release
Amazon Linux AMI release 2013.09

[root@puppet ~]# rpm -qa | egrep "puppet|facter"
puppetlabs-release-6-10.noarch
rubygem-puppet-lint-doc-0.3.2-1.el6.noarch
puppet-server-3.4.2-1.el6.noarch
rubygem-puppet-lint-0.3.2-1.el6.noarch
facter-1.7.4-1.el6.x86_64
puppet-3.4.2-1.el6.noarch
puppet-dashboard-1.2.23-1.el6.noarch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're better off installing puppet/facter from yum.puppetlabs.com

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are installed directly from PuppetLab's Yum repo. The original commit message has the output of facter from my working systems which showed that PuppetLab's Facter was reporting the following.

facter osfamily operatingsystem
operatingsystem => Amazon
osfamily => Linux

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is up...

[root@ip-10-252-105-219 ~]# rpm -i http://yum.puppetlabs.com/el/6/products/x86_64/facter-1.7.4-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.GLj5Jb: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEY
[root@ip-10-252-105-219 ~]# facter --version
1.7.4
[root@ip-10-252-105-219 ~]# facter operatingsystem osfamily
operatingsystem => Amazon
osfamily => RedHat
[root@ip-10-252-105-219 ~]# cat /etc/system-release
Amazon Linux AMI release 2013.09

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this: theforeman/puppet-apache#9

When the systems were setup, they must have been on an older version of Facter because I'm not seeing the problem now. Feel free to reject the changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this!

'debian' => '/usr/share/apache2/icons',
'redhat' => '/var/www/icons',
'amazon' => '/var/www/icons',
'freebsd' => '/usr/local/www/apache22/icons',
}
apache::mod { 'alias': }
Expand Down