/puppet-osx

Generic OS X stuffs for boxen

Primary LanguageRubyMIT LicenseMIT

OSX Defaults Module for Puppet

Build Status

Provides classes for setting various defaults in Mac OS X. Also provides a means to set a "recovery message" to be displayed on the login and lock screens.

Airdrop

include osx::airdrop::all_interfaces

class { 'osx::aidrop::all_interfaces':
  ensure => 'present',
}

Airport

osx::airport::disconnect_on_logout - disconnect from airport on logout

include osx::airport::disconnect_on_logout

class { 'osx::airport:disconnect_on_logout':
  enabled => true
}

osx::airport::join_mode - set airport join mode to one of the following:

  • Automatic
  • Preferred
  • Ranked
  • Recent
  • Strongest
class { 'osx::airport::join_mode':
  mode => 'Automatic'
}

osx::airport::join_mode_fallback - set airport join mode fallback to one of the following:

  • Prompt
  • JoinOpen
  • KeepLooking
  • DoNothing
class { 'osx::airport::join_mode_fallback':
  mode => 'Prompt'
}

osx::airport::remember_recent_networks - toggle airport's "Remember Recent Networks" preference

include osx::airport::remember_recent_networks

class { 'osx::airport::remember_recent_networks':
  ensure => 'present',
}

osx::airport::require_password_for_computer_to_computer_networks - toggle airport's "Require Password for Computer-to-Computer Networks" preference

include osx::airport::require_password_for_computer_to_computer_networks

class { 'osx::airport::require_password_for_computer_to_computer_networks':
  ensure => 'present',
}

osx::airport::require_password_to_change_networks - toggle airport's "Require Password to Change Networks" preference

include osx::airport::require_password_to_change_networks

class { 'osx::airport::require_password_to_change_networks':
  ensure => 'present',
}

osx::airport::require_password_to_toggle_power - toggle airport's "Require Password to Turn Wi-Fi On or Off" preference

include osx::airport::require_password_to_toggle_power

class { 'osx::airport::require_password_to_toggle_power':
  ensure => 'present',
}

Appearance

osx::appearance::colors - set main UI and highlight colors

class { 'osx::appearance::colors':
  main      => 'graphite',
  highlight => 'graphite'
}

osx::appearance::font_rendering_mode - set rendering mode used to display text

class { 'osx::appearance::font_rendering_mode':
  mode => 1
}

osx::appearance::sidebar_icons - set the size of the icons in the sidebar

class { 'osx::appearance::sidebar_icons':
  size => 'small'
}

class { 'osx::appearance::sidebar_icons':
  size => 'medium'
}

class { 'osx::appearance::sidebar_icons':
  size => 'large'
}

Dashboard

osx::dashboard - enable dashboard

include osx::dashboard

class { 'osx::dashboard':
  ensure => 'present',
}

Debug Mode

osx::debug_mode - toggles various debug modes

include osx::debug_mode

class { 'osx::debug_mode':
  ensure => 'present',
}

Desktop

osx::desktop::displayed_items - display items on desktop

class { 'osx::desktop::displayed_items':
    internal_hard_drives => true,
    external_hard_drives => true,
    mounted_servers => true,
    removable_media => true,
}

Dialogs

osx::dialogs::auto_expanding_print_dialog - expand print panel by default

include osx::dialogs::auto_expanding_print_dialog

class { 'osx::dialogs::auto_expanding_print_dialog':
  ensure => 'present',
}

osx::dialogs::auto_expanding_save_dialog - expand save panel by default

include osx::dialogs::auto_expanding_save_dialog

class { 'osx::dialogs::auto_expanding_save_dialog':
  ensure => 'present',
}

osx::dialogs::file_view_mode - set default file dialog view mode

class { 'osx::dialogs::file_vew_mode':
  mode => 'list'
}

Disk Images

osx::disk_images::auto_mount - set disk images to auto-mount

include osx::dialogs::auto_expanding_save_dialog

class { 'osx::disk_images::auto_mount':
  ensure => 'present',
}

osx::disk_images::verification - set verification of disk images

include osx::disk_images::verification

class { 'osx::disk_images::verification':
  ensure => 'present',
}

Disk Utility

osx::disk_utility::advanced_image_options - toggle advanced image options in disk utility

include osx::disk_utility::advanced_image_options

class { 'osx::disk_utility::advanced_image_options':
  ensure => 'present',
}

osx::disk_utility::hidden_partitions - toggle visibility of hidden partitions

include osx::disk_utility::hidden_partitions

class { 'osx::disk_utility::hidden_partitions':
  ensure => 'present',
}

Displays

osx::displays::auto_brightness_adjustment - toggle ambient light-dependent automatic brightness adjustment

include osx::dialogs::auto_expanding_save_dialog

class { 'osx::displays::auto_brightness_adjustment':
  ensure => 'present',
}

Dock

osx::dock::autohide - automatically hide the dock

include osx::dock::autohide

class { 'osx::dock::autohide':
  ensure => 'present',
  delay   => 0,
}

osx::dock::clear - ensures the dock only contains apps that are running

include osx::dock::clear

osx::dock::hidden_app_dimming - dims icons of hidden apps

include osx::dock::hidden_app_dimming

class { 'osx::dock::hidden_app_dimming':
  ensure => 'present',
}

osx::dock::icon_bounce - toggle bouncing application icon on launch or on activity

class { 'osx::dock::icon_bounce':
  on_app_launch => true,
  on_app_activity => true,
}

osx::dock::icon_size - set size of icons in dock in pixels

class { 'osx::dock::icon_size':
  size => 36
}

osx::dock::indicator_lights - toggle the indicator lights below running applications

include osx::dock::indicator_lights

class { 'osx::dock::indicator_lights':
  ensure => 'present',
}

osx::dock::itunes_notifications - toggle the indicator lights below running applications

include osx::dock::itunes_notifications

class { 'osx::dock::itunes_notifications':
  ensure => 'present',
}

osx::dock::magnification - toggles magnification of icons and sets icon magnification size

include osx::dock::magnification

class { 'osx::dock::magnification':
  ensure => 'present',
  magnified_icon_size => 48,
}

osx::dock::only_show_running_apps - only show running applications in the dock

include osx::dock::only_show_running_apps

class { 'osx::dock::only_show_running_apps':
  ensure => 'present',
}

osx::dock::orientation - set the position of the dock relative to the desktop to on of the following values:

  • 'top'
  • 'bottom'
  • 'right'
  • 'left'
class { 'osx::dock::orientation':
  orientation => 'left'
}

osx::dock::style - set the style of the dock to 2D or 3D

class { 'osx::dock::style':
  style => '2D'
}

Energy

osx::energy::disk_sleep - set time until disk sleep on battery and plugged in

class { 'osx::energy::disk_sleep':
  on_battery => 100,
  when_plugged_in => 100,
}

osx::energy::display_sleep - set time until display sleep on battery and plugged in

class { 'osx::energy::display_sleep':
  on_battery => 100,
  when_plugged_in => 100,
}

osx::energy::hibernation - set time until hibernation on battery and plugged in

class { 'osx::energy::hibernation':
  on_battery => 100,
  when_plugged_in => 100,
}

osx::energy::sleep - set time until sleep on battery and plugged in

class { 'osx::energy::sleep':
  on_battery => 100,
  when_plugged_in => 100,
}

Finder

osx::finder::allow_quit - allow quit finder

include osx::finder::allow_quit

class { 'osx::finder::allow_quit':
  ensure => 'present',
}

osx::finder::animations - enable finder animations

include osx::osx::finder::animations

class { 'osx::finder::animations':
  ensure => 'present',
}

osx::finder::date_format - set finder date format to 'relative' or 'absolute'

class { 'osx::finder::date_format':
  format => 'relative'
}

osx::finder::default_file_view_mode - set finder default file view mode to one of the following:

  • list

Not yet implemented:

  • icon
  • column
  • cover flow
class { 'osx::finder::default_file_view_mode':
  mode => 'list'
}

osx::finder::default_location - set finder default view location to one of the following:

  • 'home directory'
class { 'osx::finder::default_location':
  location => 'home directory'
}

osx::finder::default_search_scope - set finder default scope when using the search box in finder to one of the following:

  • 'home directory'
class { 'osx::finder::default_search_scope':
  scope => 'current folder'
}

osx::finder::file_extensions - set finder to display all file extensions and warn when changing the file extension

class { 'osx::finder::file_extensions':
  display_all => true,
  warn_on_change => false,
}

osx::finder::icon_arrangement - set finder icon arrangement

class { 'osx::finder::icon_arrangement':
  style => 'grid'
}

osx::finder::icon_previews - enable icon previews in finder

include osx::finder::icon_previews

class { 'osx::finder::icon_previews':
  ensure => 'present',
}

osx::finder::path_bar - enable path bar in finder

include osx::finder::path_bar

class { 'osx::finder::path_bar':
  ensure => 'present',
}

osx::finder::posix_title_path - enable full POSIX path in finder title bar

include osx::finder::posix_title_path

class { 'osx::finder::posix_title_path':
  ensure => 'present',
}

osx::finder::quicklook_text_selection - enable text selection in QuickLook Window

include osx::finder::quicklook_text_selection

class { 'osx::finder::quicklook_text_selection':
  ensure => 'present',
}

osx::finder::springing - enable springing and set spring delay

class { 'osx::finder::springing':
  ensure => 'present',
  delay => 0,
}

osx::finder::status_bar - display status bar in finder

include osx::finder::status_bar

class { 'osx::finder::status_bar':
  ensure => 'present',
}

osx::finder::unhide_library - unsets the hidden flag on ~/Library

Firewall

osx::firewall - toggles firewall

include osx::firewall

class { 'osx::firewall':
  ensure => 'present',
}

osx::firewall::auto_allow_signed_applications - allow signed apps to automatically accept incoming connections

include osx::firewall::auto_allow_signed_applications

class { 'osx::firewall::auto_allow_signed_applications':
  ensure => 'present',
}

osx::firewall::block_all_incoming_connections - block all non-essential incoming connections

include osx::firewall::block_all_incoming_connections

class { 'osx::firewall::block_all_incoming_connections':
  ensure => 'present',
}

osx::firewall::logging_mode - set firewall logging mode

include osx::firewall::logging_mode

class { 'osx::firewall::logging_mode':
  ensure => 'present',
}

osx::firewall::stealth_mode - set whether firewall responds to innocuous requests like PING

include osx::firewall::stealth_mode

class { 'osx::firewall::stealth_mode':
  ensure => 'present',
}

Gatekeeper

osx::gatekeeper - toggles gatekeeper

include osx::gatekeeper

class { 'osx::gatekeeper':
  ensure => 'present',
}

Hot Corners

osx::hot_corners - set actions to hot corners:

Corners:

  • 'bottom left'
  • 'bottom right'
  • 'top right'
  • 'top left'

Actions:

  • 'do nothing'
  • 'mission control'
  • 'show application windows'
  • 'desktop'
  • 'start screensaver'
  • 'disable screensaver'
  • 'dashboard'
  • 'sleep display'
  • 'launchpad'
  • 'notification center'
class { 'osx::hot_corners':
  corner => 'bottom left',
  action => 'mission control',
}

iTunes

osx::itunes::automatic_device_backup_when_syncing - set iTunes to automatically back up device on sync

osx::itunes::automatic_device_backup_when_syncing

class { 'osx::itunes::automatic_device_backup_when_syncing':
  ensure => 'present',
}

osx::itunes::automatic_sync - set iTunes to automatically sync devices when connected

include osx::itunes::automatic_sync

class { 'osx::itunes::automatic_sync':
  ensure => 'present',
}

Keyboard

osx::keyboard::accented_press_and_hold - press and hold for accented characters

include osx::keyboard::accented_press_and_hold

class { 'osx::keyboard::accented_press_and_hold':
  ensure => 'present',
}

osx::keyboard::autocorrect - enable autocorrect

include osx::keyboard::autocorrect

class { 'osx::keyboard::autocorrect':
  ensure => 'present',
}

osx::keyboard::control_access - set keyboard access for controls to one of the following:

  • 'all_controls_including_dropdowns'
  • 'all_controls'
  • 'basic'
class { 'osx::keyboard::control_access':
  mode => 'basic',
}

osx::keyboard::default_to_alternate_function_keys - default to "alternate" function keys when not holding the "fn" key

include osx::keyboard::default_to_alternate_function_keys

class { 'osx::keyboard::default_to_alternate_function_keys':
  ensure => 'present',
}

osx::keyboard::illumination - enabled keyboard illumination, automatic brightness depending on ambient light, and idle time before illumination turns off

class { 'osx::keyboard::illumination':
  ensure => 'present',
  auto_dim => true,
  auto_off_delay => 5,
}

osx::keyboard::key_repeat_delay - set the time in ms before key press repeats

class { 'osx::keyboard::key_repeat_delay':
  delay => 35,
}

osx::keyboard::key_repeat_rate - the amount of time (in ms) before key repeat 'presses'

class { 'osx::keyboard::key_repeat_rate':
  rate => 0
}

Launchpad

osx::launchpad::reset - reset launchpad

include osx::launchpad::reset

Login

osx::login::admin_information - show admin information when clicking the clock on the login screen

include osx::login::admin_information

class { 'osx::login::admin_information':
  ensure => 'present',
}

osx::login::auto_login - automatically login a user

include osx::login::auto_login

class { 'osx::login::auto_login':
  ensure => 'present',
}

osx::login::fast_user_switching - automatically login a user

include osx::login::fast_user_switching

class { 'osx::login::fast_user_switching':
  ensure => 'present',
}

osx::login::guest - enable guest account

include osx::login::guest

class { 'osx::login::guest':
  ensure => 'present',
}

osx::login::power_options - show power options on the login screen

include osx::login::power_options

class { 'osx::login::power_options':
  ensure => 'present',
}

osx::login::retries_before_hint - number of attempts before password hint is displayed

class { 'osx::login::retries_before_hint':
  attempts => 5
}

osx::login::style - set the default login screen style to one of the following:

  • 'name and password'
class { 'osx::login::style':
  style => 'name and password'
}

Menu Bar

osx::menu_bar::airplay - show the AirPlay Mirroring icon in the menu bar

include osx::menu_bar::airplay

class { 'osx::menu_bar::airplay':
  ensure => 'present',
}

osx::menu_bar::date - set the format of the date in the menu bar and set the clock to analog

class { 'osx::menu_bar::date':
  format    => 'E MMM d  h:mm a',
  is_analog => true,
}

osx::menu_bar::transparency - set menu bar transparency

include osx::finder::status_bar

class { 'osx::menu_bar::transparency':
  ensure => 'present',
}

Mission Control

osx::mission_control::animation - set speed of transitioning into and out of mission control

class { 'osx::mission_control::animation':
  speed => 10
}

osx::mission_control::dashboard_visibility - toggle visibility of dashboard as a space in mission control

include osx::mission_control::dashboard_visibility

class { 'osx::mission_control::dashboard_visibility':
  ensure => 'present',
}

osx::mission_control::group_by_app - group multiple windows for an app in mission control

include osx::mission_control::group_by_app

class { 'osx::mission_control::group_by_app':
  ensure => 'present',
}

Mouse

osx::mouse::movement - set scaling and speed of mouse cursor movement

class { 'osx::mouse::movement':
  scaling         => 10,
  scrolling_speed => 10,
}

Network

osx::network::default_login_name - set custom default login name for networks

class { 'osx::network::default_login_name':
  default_name => 'name',
}

osx::network::dsstores - create .DS_Store files on network volumes

include osx::network::dsstores

class { 'osx::network::dsstores':
  ensure => 'present',
}

osx::network::guest - enable guest access to shared folders

include osx::network::guest

class { 'osx::network::guest':
  ensure => 'present',
}

Printing

osx::printing::quit_when_finished - toggle whether the print dialog should disappear when all jobs are complete

include osx::printing::quit_when_finished

class { 'osx::printing::quit_when_finished':
  ensure => 'present',
}

Safari

osx::safari::find_only_matches_at_beginning_of_word - toggle whether "Find On Page" matches only the beginnings of words

include osx::safari::find_only_matches_at_beginning_of_word

class { 'osx::safari::find_only_matches_at_beginning_of_word':
  ensure => 'present',
}

osx::safari::homepage - set the default safari homepage

class { 'osx::safari::homepage':
  page => 'github.com',
}

osx::safari::thumbnail_cache - toggle cache for "Top Sites" and "History"

include osx::safari::thumbnail_cache

class { 'osx::safari::thumbnail_cache':
  ensure => 'present',
}

Screen Capture

osx::screen_capture - set screen capture settings

class { 'osx::screen_capture
  format     => 'jpg',
  location   => '/tmp',
  add_shadow => false,
  base_name  => 'screencap_',
}

Screensaver

osx::screensaver::password_protection - set password requirement to disable sreen saver, and delay before screen saver is required

include osx::screensaver::password_protection

class { 'osx::screensaver::password_protection':
  ensure => 'present',
  delay => 0,
}

Security

osx::security::system_preference_lock - lock system preferences

include osx::security::system_preference_lock

class { 'osx::security::system_preference_lock':
  ensure => 'present',
}

Sound

osx::sound::bluetooth - set the audio bitpool for bluetooth audio devices

class { 'osx::sound::bluetooth':
  audio_bitpool => 36,
}

osx::sound::ui - toggle and set volume for UI sound effects

include osx::sound::ui

class { 'osx::sound::ui':
  ensure => 'present',
  level => 36,
}

osx::sound::volume_feedback - toggle volume change feedback sound

include osx::sound::volume_feedback

class { 'osx::sound::volume_feedback':
  ensure => 'present',
}

System

osx::system::update::automatic_downloads - toggle downloading software updates in the background when available

include osx::system::update::automatic_downloads

class { 'osx::system::update::automatic_downloads':
  ensure => 'present',
}

osx::system::update::local_cdn - toggle downloading software updates in the background when available

include osx::system::update::local_cdn

class { 'osx::system::update::local_cdn':
  ensure => 'present',
}

osx::system::update::schedule - set the interval between software update checks to one of the following:

  • 'daily'
class { 'osx::system::update::schedule':
  frequencey => 'daily',
}

osx::system::app_quarantine - toggle the downloaded app quarantine

include osx::system::app_quarantine

class { 'osx::system::app_quarantine':
  ensure => 'present',
}

osx::system::automatic_app_termination - toggle whether to automatically quit idle apps

include osx::system::automatic_app_termination

class { 'osx::system::automatic_app_termination':
  ensure => 'present',
}

osx::system::crash_reporter - send usage statistics to Apple

include osx::system::crash_reporter

class { 'osx::system::crash_reporter':
  ensure => 'present',
}

osx::system::host_name - set your host name

class { 'osx::system::host_name':
  name => 'localHost',
}

osx::system::restart_on_hang - restart automatically if system hangs

include osx::system::restart_on_hang

class { 'osx::system::restart_on_hang':
  ensure => 'present',
}

osx::system::recovery_message - set the system recovery message

class { 'osx::system::recovery_message':
  ensure => 'present',
  value => 'message',
}

osx::system::save_documents_to_icloud_by_default - save documents to iCloud by default

include osx::system::save_documents_to_icloud_by_default

class { 'osx::system::save_documents_to_icloud_by_default':
  ensure => 'present',
}

osx::system::save_windows_on_quit - save windows and positions when restarting/quitting

include osx::system::save_windows_on_quit

class { 'osx::system::save_windows_on_quit':
  ensure => 'present',
}

osx::system::ui_server

include osx::system::ui_server

Time Machine

osx::time_machine::ask_to_use_new_disks_for_backup

include osx::time_machine::ask_to_use_new_disks_for_backup

class { 'osx::time_machine::ask_to_use_new_disks_for_backup':
  ensure => 'present',
}

osx::time_machine::local_backups

include osx::time_machine::local_backups

class { 'osx::time_machine::local_backups':
  ensure => 'present',
}

osx::time_machine::unsupported_network_volumes

include osx::time_machine::unsupported_network_volumes

class { 'osx::time_machine::unsupported_network_volumes':
  ensure => 'present',
}

Touchpad

osx::touchpad::gestures::app_expose - toggle swipe for app expose

include osx::touchpad::gestures::app_expose

class { 'osx::touchpad::gestures::app_expose':
  ensure => 'present',
}

osx::touchpad::gestures::four_finger_horizontal_swipe - set the effect for left/right swipe with four fingers to one of the following:

  • 'disabled'
  • 'switch apps'
class { 'osx::touchpad::gestures::four_finger_horizontal_swipe':
  effect => 'disabled',
}

osx::touchpad::gestures::four_finger_vertical_swipe - set the effect for up/down swipe with four fingers to one of the following:

  • 'disabled'
  • 'mission control'
class { 'osx::touchpad::gestures::four_finger_vertical_swipe':
  effect => 'disabled',
}

osx::touchpad::gestures::launchpad - toggle pinch with thumb and thee fingers for launchpad

include osx::touchpad::gestures::launchpad

class { 'osx::touchpad::gestures::launchpad':
  ensure => 'present',
}

osx::touchpad::gestures::page_swiping - toggle swipe to switch pages

include osx::touchpad::gestures::page_swiping

class { 'osx::touchpad::gestures::page_swiping':
  ensure => 'present',
}

osx::touchpad::gestures::secondary_click - toggle secondary 'right click' on internal toucpad, external touchpad, and magic mouse

include osx::touchpad::gestures::secondary_click

class { 'osx::touchpad::gestures::secondary_click':
  ensure => 'present',
}

osx::touchpad::gestures::tap_to_click - toggle touchpad tap to click

include osx::touchpad::gestures::tap_to_click

class { 'osx::touchpad::gestures::tap_to_click':
  ensure => 'present',
}

osx::touchpad::gestures::tap_to_drag - toggle touchpad tap to drag

include osx::touchpad::gestures::tap_to_drag

class { 'osx::touchpad::gestures::tap_to_drag':
  ensure => 'present',
}

osx::touchpad::gestures::three_finger_horizontal_swipe - set the effect for swiping left/right with three fingers

  • 'switch pages'
  • 'switch apps'
class { 'osx::touchpad::gestures::three_finger_horizontal_swipe':
  effect => 'switch pages',
}

osx::touchpad::gestures::three_finger_vertical_swipe - set the effect for swiping up/down with three fingers

  • 'disabled'
  • 'mission control'
class { 'osx::touchpad::gestures::three_finger_vertical_swipe':
  effect => 'disabled',
}

osx::touchpad::movement - set speed of trackpad cursor movement and trackpad scrolling

class { 'osx::touchpad::movement':
  scaling => 5,
  scrolling_speed => 10,
}

Trash

osx::trash::when_emptying - toggle empty trash warning and secure trash emptying

class { 'osx::trash::when_emptying':
  warn   => false,
  secure => true,
}

Global

osx::global::natural_mouse_scrolling - enable/disable 'natural' mouse scrolling. Requires re-login for new settings to initialize.

# Set the default value (enabled=true)
include osx::global::natural_mouse_scrolling

# ... or set your own
class { 'osx::global::natural_mouse_scrolling':
  enabled => false
}

Universal Access

osx::universal_access::assistive_device_access - toggle assistive device access

include osx::universal_access::assistive_device_access

class { 'osx::universal_access::assistive_device_access':
  ensure => 'present',
}

osx::universal_access::ctrl_mod_zoom - enables zoom by scrolling while holding Control

include osx::universal_access::ctrl_mod_zoom

osx::universal_access::cursor_size - the amount the cursor will be zoomed

# Set the default value (1.5)
include osx::universal_access::cursor_size

# ... or set your own
class { 'osx::universal_access::cursor_size':
  zoom => 2
}

osx::universal_access::flash_screen - toggle screen flashing on alert

include osx::universal_access::flash_screen

class { 'osx::universal_access::flash_screen':
  ensure => 'present',
}

osx::universal_access::enable_scrollwheel_zoom - enables zoom using the scroll wheel

Windows

osx::windows::animations - toggle open/close window animations and set the length of time in seconds when a window is resized

class { 'osx::windows::animations':
  ensure => 'present',
  resize_duration => 4,
}

osx::windows::miniaturize_on_double_click - miniaturize windows on double-click

include osx::windows::miniaturize_on_double_click

class { 'osx::windows::miniaturize_on_double_click':
  ensure => 'present',
}

osx::windows::scroll_bars - set the scrollbar mode

include osx::windows::scroll_bars

class { 'osx::windows::scroll_bars':
  style => "Automatic"
}

Required Puppet Modules

  • boxen
  • property_list_key

Developing

Write code.

Write tests.

Run script/cibuild.