-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I had the following error several times already. This error log is from a fresh laptop with MacOSX Sierra but I have had the same issue on El Capitan. The error is the following:
Error: Facter: error while resolving custom fact "git_version": undefined method `strip' for nil:NilClass
Error: Failed to apply catalog: No command brew defined for provider brew
The error happens just after the user gets prompted to install the command line tools via a GUI installer window. I think this installer is triggered when the module or something else tries to use curl or similar.
If I run puppet agent -t after installing the command line tools manually it still doesn't work and keep reporting the following error:
Error: Failed to apply catalog: No command brew defined for provider brew
To get going I just install brew from the command line supplied on brew.sh and re run puppet agent -t to finish with my puppet setup. Somehow after the install is run once it doesn't check if it's correctly setup/present so it doesn't try to install it again.
The way I use the module is the following:
# Add Homebrew and BrewCask
if versioncmp($::macosx_productversion_major, '10.12') >= 0 {
class { 'homebrew':
user => 'it',
command_line_tools_package => 'Command_Line_Tools_macOS_10.12_for_Xcode_8.dmg',
command_line_tools_source => 'https://storage.googleapis.com/improbable-public-storage/Command_Line_Tools_macOS_10.12_for_Xcode_8.dmg',
require => [ User['it'], Exec['run-startup-script'], Package['puppet-agent'] ],
}
} else {
class { 'homebrew':
user => 'it',
command_line_tools_package => 'Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg',
command_line_tools_source => 'https://storage.googleapis.com/improbable-public-storage/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg',
require => [ User['it'], Exec['run-startup-script'], Package['puppet-agent'] ],
}
}