{"action":"created","issue":{"url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/17","repository_url":"https://api.github.com/repos/TheKevJames/puppet-homebrew","labels_url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/17/comments","events_url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/17/events","html_url":"https://github.com/TheKevJames/puppet-homebrew/issues/17","id":149314463,"number":17,"title":"has_compiler fact not set","user":{"login":"amosshapira","id":654521,"avatar_url":"https://avatars.githubusercontent.com/u/654521?v=3","gravatar_id":"","url":"https://api.github.com/users/amosshapira","html_url":"https://github.com/amosshapira","followers_url":"https://api.github.com/users/amosshapira/followers","following_url":"https://api.github.com/users/amosshapira/following{/other_user}","gists_url":"https://api.github.com/users/amosshapira/gists{/gist_id}","starred_url":"https://api.github.com/users/amosshapira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amosshapira/subscriptions","organizations_url":"https://api.github.com/users/amosshapira/orgs","repos_url":"https://api.github.com/users/amosshapira/repos","events_url":"https://api.github.com/users/amosshapira/events{/privacy}","received_events_url":"https://api.github.com/users/amosshapira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-19T00:57:06Z","updated_at":"2016-04-20T02:02:25Z","closed_at":null,"body":"I'm trying to use version 1.3.0 of the module (taken from the Puppet Forge) on OSX 10.11 with Puppet 3.8.6 and Facter 2.4.6 and hit a problem where the `confine` in `lib/facter/has_compiler.rb` don't trigger any of the settings, causing `has_compiler` to be set to `nil` and the module tries to install the command line tools and Homebrew when it shouldn't (they are already available on the sever).\r\n\r\nI added the following debug prints to `has_compiler.rb`:\r\n\r\n```\r\n--- has_compiler.rb\t2016-02-03 14:11:58.000000000 +1100\r\n+++ .../has_compiler.rb\t2016-04-19 10:49:10.000000000 +1000\r\n@@ -1,12 +1,15 @@\r\n Facter.add(:has_compiler) do\r\n+  puts(\"Inside has_compiler, operatingsystem: #{Facter.value(:operatingsystem)}; macosx_productversion_major: #{Facter.value(:macosx_productversion_major)}\")\r\n   confine :operatingsystem => :darwin\r\n   setcode do\r\n+    puts('Inside :operatingsystem => :darwin')\r\n     File.exists?('/usr/bin/cc') || system('/usr/bin/xcrun -find cc >/dev/null 2>&1')\r\n   end\r\n\r\n   # /usr/bin/cc exists in Mavericks, but it's not real\r\n   confine :macosx_productversion_major => '10.9'\r\n   setcode do\r\n+    puts('Inside :macosx_productversion_majon => 10.9')\r\n     (File.exists?('/Applications/Xcode.app') or File.exists?('/Library/Developer/CommandLineTools/')) and\r\n     (File.exists?('/usr/bin/cc') || system('/usr/bin/xcrun -find cc >/dev/null 2>&1'))\r\n   end\r\n```\r\nAnd when I run `puppet apply` I can see that the `confine` don't match:\r\n```\r\n$ puppet apply --verbose --modulepath modules -e 'class { \"homebrew\": }'\r\n...\r\nInside has_compiler, operatingsystem: Darwin; macosx_productversion_major: 10.11\r\nWarning: Config file /Users/ashapira/.puppet/hiera.yaml not found, using Hiera defaults\r\nNotice: Scope(Class[Homebrew::Compiler]): Installing Command Line Tools.\r\n...\r\n```\r\nAnd of course it fails because it tries to download a `.dmg` file from a URL which doesn't exist.\r\n\r\nAny guidance on how can I get around this?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/comments/212208919","html_url":"https://github.com/TheKevJames/puppet-homebrew/issues/17#issuecomment-212208919","issue_url":"https://api.github.com/repos/TheKevJames/puppet-homebrew/issues/17","id":212208919,"user":{"login":"TheKevJames","id":3341822,"avatar_url":"https://avatars.githubusercontent.com/u/3341822?v=3","gravatar_id":"","url":"https://api.github.com/users/TheKevJames","html_url":"https://github.com/TheKevJames","followers_url":"https://api.github.com/users/TheKevJames/followers","following_url":"https://api.github.com/users/TheKevJames/following{/other_user}","gists_url":"https://api.github.com/users/TheKevJames/gists{/gist_id}","starred_url":"https://api.github.com/users/TheKevJames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheKevJames/subscriptions","organizations_url":"https://api.github.com/users/TheKevJames/orgs","repos_url":"https://api.github.com/users/TheKevJames/repos","events_url":"https://api.github.com/users/TheKevJames/events{/privacy}","received_events_url":"https://api.github.com/users/TheKevJames/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T02:02:25Z","updated_at":"2016-04-20T02:02:25Z","body":"(also: thanks for pointing out the `warn` issue. TIL puppet is not ruby; the puppet `warning` function maps to `warn` in ruby)"}}