Skip to content

Commit a3f0eeb

Browse files
Merge pull request #126 from dschaaff/master
Add additional support for Mac OS X
2 parents fbeae85 + 1483e9f commit a3f0eeb

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

manifests/agent.pp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# ['puppet_server'] - The dns name of the puppet master
77
# ['puppet_server_port'] - The Port the puppet master is running on
88
# ['puppet_agent_service'] - The service the puppet agent runs under
9+
# ['mac_version'] - The package version for Mac OS X
10+
# ['mac_facter_version'] - The Factor Version for Mac OS X
911
# ['puppet_agent_package'] - The name of the package providing the puppet agent
1012
# ['version'] - The version of the puppet agent to install
1113
# ['puppet_run_style'] - The run style of the agent either 'service', 'cron', 'external' or 'manual'
@@ -58,6 +60,7 @@
5860
$puppet_agent_service = $::puppet::params::puppet_agent_service,
5961
$puppet_agent_package = $::puppet::params::puppet_agent_package,
6062
$version = 'present',
63+
$puppet_facter_package = $::puppet::params::puppet_facter_package,
6164
$puppet_run_style = 'service',
6265
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
6366
$user_id = undef,
@@ -121,9 +124,25 @@
121124
gid => $group_id,
122125
}
123126
}
124-
package { $puppet_agent_package:
125-
ensure => $version,
126-
provider => $package_provider,
127+
case $::osfamily {
128+
'Darwin': {
129+
package {$puppet_facter_package:
130+
ensure => present,
131+
provider => $package_provider,
132+
source => "https://downloads.puppetlabs.com/mac/${puppet_facter_package}",
133+
}
134+
package { $puppet_agent_package:
135+
ensure => present,
136+
provider => $package_provider,
137+
source => "https://downloads.puppetlabs.com/mac/${puppet_agent_package}"
138+
}
139+
}
140+
default: {
141+
package { $puppet_agent_package:
142+
ensure => $version,
143+
provider => $package_provider,
144+
}
145+
}
127146
}
128147

129148
if $puppet_run_style == 'service' {
@@ -471,9 +490,9 @@
471490
}
472491
unless defined(Package['msgpack']) {
473492
package {'msgpack':
474-
ensure => 'latest',
475-
provider => 'gem',
476-
require => Package[$::puppet::params::ruby_dev, 'gcc'],
493+
ensure => 'latest',
494+
provider => 'gem',
495+
require => Package[$::puppet::params::ruby_dev, 'gcc'],
477496
}
478497
}
479498
}

manifests/params.pp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
$digest_algorithm = 'md5'
3434
$puppet_run_interval = 30
3535
$classfile = '$statedir/classes.txt'
36-
$package_provider = undef # falls back to system default
3736
$rundir = '/var/run/puppet'
3837
$puppet_passenger_ssl_protocol = 'TLSv1.2'
3938
$puppet_passenger_ssl_cipher = 'AES256+EECDH:AES256+EDH'
@@ -47,6 +46,7 @@
4746
$puppet_master_service = 'puppetmaster'
4847
$puppet_agent_service = 'puppet'
4948
$puppet_agent_package = 'puppet'
49+
$package_provider = undef # falls back to system default
5050
$puppet_defaults = '/etc/sysconfig/puppet'
5151
$puppet_conf = '/etc/puppet/puppet.conf'
5252
$puppet_vardir = '/var/lib/puppet'
@@ -60,6 +60,7 @@
6060
$puppet_master_service = 'puppetmasterd'
6161
$puppet_agent_service = 'puppet'
6262
$puppet_agent_package = 'puppet'
63+
$package_provider = undef # falls back to system default
6364
$puppet_conf = '/etc/puppet/puppet.conf'
6465
$puppet_vardir = '/var/lib/puppet'
6566
$puppet_ssldir = '/var/lib/puppet/ssl'
@@ -71,6 +72,7 @@
7172
$puppet_master_service = 'puppetmaster'
7273
$puppet_agent_service = 'puppet'
7374
$puppet_agent_package = 'puppet'
75+
$package_provider = undef # falls back to system default
7476
$puppet_defaults = '/etc/default/puppet'
7577
$puppet_conf = '/etc/puppet/puppet.conf'
7678
$puppet_vardir = '/var/lib/puppet'
@@ -82,13 +84,16 @@
8284
'FreeBSD': {
8385
$puppet_agent_service = 'puppet'
8486
$puppet_agent_package = 'sysutils/puppet'
87+
$package_provider = undef # falls back to system default
8588
$puppet_conf = '/usr/local/etc/puppet/puppet.conf'
8689
$puppet_vardir = '/var/puppet'
8790
$puppet_ssldir = '/var/puppet/ssl'
8891
}
8992
'Darwin': {
9093
$puppet_agent_service = 'com.puppetlabs.puppet'
91-
$puppet_agent_package = 'puppet'
94+
$puppet_agent_package = 'puppet-3.8.5.dmg'
95+
$puppet_facter_package = 'facter.2.4.5.dmg'
96+
$package_provider = 'pkgdmg'
9297
$puppet_conf = '/etc/puppet/puppet.conf'
9398
$puppet_vardir = '/var/lib/puppet'
9499
$puppet_ssldir = '/etc/puppet/ssl'

0 commit comments

Comments
 (0)