Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is a giant Puppet module. It abstracts all the things. It won't win any awa
Some of this stuff is very useful, a lot of it is new, all of it is IN ONE PLACE.

* Mobileconfig Type for managing OS X profiles
* Propertylist Type for managing OS X plist and preferences
* Property_list Type for managing OS X plist and preferences
* Macauthdb Type for managing OS X Authorization DB
* Macgroup Type for managing groups-in-groups
* Manages Login/Logout Hooks globally
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/dsconfigad/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'cfpropertylist'
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'managedmac', 'common'))

Puppet::Type.type(:dsconfigad).provide(:default) do

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/macgroup/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'cfpropertylist'
require 'puppet/provider/mobileconfig'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'provider', 'mobileconfig'))

Puppet::Type.type(:macgroup).provide(:default) do

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mobileconfig.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'cfpropertylist'
require 'securerandom'
require 'fileutils'
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'managedmac', 'common'))

class Puppet::Provider::MobileConfig < Puppet::Provider

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mobileconfig/default.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'puppet/provider/mobileconfig'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'provider', 'mobileconfig'))

Puppet::Type.type(:mobileconfig).provide(:default,
:parent => Puppet::Provider::MobileConfig) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def instances
args = Puppet::Util::CommandLine.new.args
resource_type, resource_name = args.each { |x| x }
unless resource_name
err = ['Listing propertylist instances is not supported.',
err = ['Listing property_list instances is not supported.',
'Please specify a file or directory, e.g. puppet resource file /etc'].join(' ')
raise Puppet::Error, err
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'puppet/provider/propertylist'
require File.dirname(__FILE__)

Puppet::Type.type(:propertylist).provide(:default,
Puppet::Type.type(:property_list).provide(:default,
:parent => Puppet::Provider::PropertyList) do

defaultfor :operatingsystem => :darwin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'puppet/provider/propertylist'
require File.dirname(__FILE__)

Puppet::Type.type(:propertylist).provide(:defaults,
Puppet::Type.type(:property_list).provide(:defaults,
:parent => Puppet::Provider::PropertyList) do

commands :defaults => '/usr/bin/defaults'
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/remotemanagement/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'fileutils'
require 'cfpropertylist'
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'managedmac', 'common'))

Puppet::Type.type(:remotemanagement).provide(:default) do
desc "Abstracts the Mac OS X kickstart command, allowing management of the Apple Remote Desktop features."
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/macgroup.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'managedmac', 'common'))

Puppet::Type.newtype(:macgroup) do
@doc = %q{A drop-in replacement for the built-in Puppet Type: Group
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/mobileconfig.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'managedmac', 'common'))

Puppet::Type.newtype(:mobileconfig) do
@doc = %q{Dynamically create and manage OS X .mobileconfig profiles
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'puppet/managedmac/common'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'managedmac', 'common'))

Puppet::Type.newtype(:propertylist) do
Puppet::Type.newtype(:property_list) do
desc %q{Puppet type for managing OS X PropertyLists.

Suitable for the creation and management of configuration files and
Expand All @@ -10,9 +10,9 @@

# You can transpose a PropertyList file into a Puppet resource.

`sudo puppet resource propertylist /Library/Preferences/com.apple.loginwindow.plist `
`sudo puppet resource property_list /Library/Preferences/com.apple.loginwindow.plist `

propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
ensure => 'present',
content => {'MCXLaunchAfterUserLogin' => 'true',
'OptimizerLastRunForBuild' => '27396096',
Expand All @@ -33,7 +33,7 @@

$content = { LoginwindowText => 'A message to you, Rudy.' }

propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
ensure => present,
method => insert,
content => $content,
Expand All @@ -56,7 +56,7 @@

$content = { LoginwindowText => 'A message to you, Rudy.' }

propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
ensure => present,
method => insert,
content => $content,
Expand Down Expand Up @@ -137,7 +137,7 @@

$content = { LoginwindowText => 'A message to you, Rudy.' }

propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
ensure => present,
method => insert,
content => $content,
Expand Down Expand Up @@ -213,7 +213,7 @@ def is_to_s(value)
end

newparam(:method) do
desc %q{Whether to overwrite the propertylist, or insert the specified data.
desc %q{Whether to overwrite the property_list, or insert the specified data.

This behaviour demands a detailed explanation, because it's not as simple
as it sounds. First, a little about PropertyLists in general...
Expand Down Expand Up @@ -316,7 +316,7 @@ def is_to_s(value)

# Here is our resource declaration, but notice that we have set the
# :method parameter to :insert
propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
ensure => present,
group => 'staff',
mode => '0644',
Expand Down Expand Up @@ -348,7 +348,7 @@ def is_to_s(value)
$content = [1, 2, 3, 4, 5]

# Some non-essential params removed
propertylist { '/Library/Preferences/com.apple.loginwindow.plist':
property_list { '/Library/Preferences/com.apple.loginwindow.plist':
content => $content,
method => insert,
}
Expand Down Expand Up @@ -383,7 +383,7 @@ def is_to_s(value)

This array has 5 elements. Let's create a PropertyList with it.

propertylist { '/Users/Shared/foo.plist':
property_list { '/Users/Shared/foo.plist':
format => xml,
content => $content,
method => insert,
Expand All @@ -406,7 +406,7 @@ def is_to_s(value)

$content = [1, 2, 3, 5]

propertylist { '/Users/Shared/foo.plist':
property_list { '/Users/Shared/foo.plist':
format => xml,
content => $content,
method => insert,
Expand Down
2 changes: 1 addition & 1 deletion manifests/propertylists.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

validate_raw_constructor ($files)
validate_hash ($defaults)
create_resources(propertylist, $files, $defaults)
create_resources(property_list, $files, $defaults)

}

Expand Down
30 changes: 13 additions & 17 deletions manifests/softwareupdate.pp
Original file line number Diff line number Diff line change
Expand Up @@ -99,48 +99,44 @@
# Copyright 2015 Simon Fraser University, unless otherwise noted.
#
class managedmac::softwareupdate (

$catalog_url = undef,
$allow_pre_release_installation = undef,
$automatic_update_check = undef,
$auto_update_apps = undef,
$automatic_download = undef,
$config_data_install = undef,
$critical_update_install = undef,
$auto_update_restart_required = undef,

) {

$auto_update_restart_required = undef,) {
unless $allow_pre_release_installation == undef {
validate_bool ($allow_pre_release_installation)
validate_bool($allow_pre_release_installation)
}

unless $automatic_update_check == undef {
validate_bool ($automatic_update_check)
validate_bool($automatic_update_check)
}

unless empty($catalog_url) {
validate_re ($catalog_url, '\Ahttps?:\/\/(-*\w+-*(\.|-))+-*\w+-*\/')
validate_re($catalog_url, '\Ahttps?:\/\/(-*\w+-*(\.|-))+-*\w+-*\/')
}

unless $automatic_download == undef {
validate_bool ($automatic_download)
validate_bool($automatic_download)
}

unless $auto_update_apps == undef {
validate_bool ($auto_update_apps)
validate_bool($auto_update_apps)
}

unless $config_data_install == undef {
validate_bool ($config_data_install)
validate_bool($config_data_install)
}

unless $critical_update_install == undef {
validate_bool ($critical_update_install)
validate_bool($critical_update_install)
}

unless $auto_update_restart_required == undef {
validate_bool ($auto_update_restart_required)
validate_bool($auto_update_restart_required)
}

$store_plist_content = {
Expand All @@ -165,14 +161,14 @@
$autoupdate_plist_ensure = compact_hash($autoupdate_plist_content)

unless empty($autoupdate_plist_ensure) {
propertylist { $autoupdate_plist_path:
property_list { $autoupdate_plist_path:
ensure => present,
content => $autoupdate_plist_content,
owner => 'root',
group => 'wheel',
mode => '0644',
method => insert,
provider => defaults,
provider => defaults
}
}

Expand All @@ -186,14 +182,14 @@
$swup_plist_ensure = compact_hash($swup_plist_content)

unless empty($swup_plist_content) {
propertylist { '/Library/Preferences/com.apple.SoftwareUpdate.plist':
property_list { '/Library/Preferences/com.apple.SoftwareUpdate.plist':
ensure => present,
content => $swup_plist_content,
owner => 'root',
group => 'wheel',
mode => '0644',
method => insert,
provider => defaults,
provider => defaults
}
}

Expand Down