Permalink
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (85 sloc) 3.68 KB

ard

Use the ard resource to manage the "Remote Management" settings, found in System Preferences > Sharing > Remote Management. Under the hood, an ard resource executes the kickstart command, located in ARDAgent.app (one of macOS' "core services"). It has some basic actions, which pertain to the simple kickstart subcommands. It also has the more complicated :configure action, which requires some familiarity with kickstart.

Syntax

An ard resource block declares a basic description of the command configuration and a set of properties depending on the actions executed. For example:

ard 'activate and configure ard' do
  action [:activate, :configure]
end

where

  • :activate activates the ARD agent
  • :configure configures the agent using the kickstart defaut commandline arguments.

The default :configure action is equivalent to the following System Preferences > Sharing settings:

Sharing Preferences

The full syntax for all of the properties that are available to the ard resource is:

ard 'description' do
  install_package                String
  uninstall_options              Array # defaults to ['-files', '-settings', '-prefs'] if not specified
  restart_options                Array # defaults to ['-agent', '-console', '-menu'] if not specified
  users                          Array
  privs                          Array # defaults to ['-all'] if not specified
  access                         String # defaults to '-on' if not specified
  allow_access_for               String # defaults to '-allUsers' if not specified
  computerinfo                   Array
  clientopts                     Array
  action                         Symbol # defaults to [:activate, :configure] if not specified
end

⚠️ Not all properties are compatible with each action. For example, the uninstall_options property is only applicable when the :uninstall action is used.

Actions

This resource has the following actions:

:activate

      Activate the remote desktop agent.

:deactivate

      Deactivate the remote desktop agent.

:uninstall

      Uninstall a package from another remotely managed Mac.

:stop

      Stop the agent.

:restart

      Restart the remote desktop agent.

:configure

      Configure the setup of the remote desktop agent using the default options.

Properties

install_package

      Ruby Type: String

uninstall_options

      Ruby type: Array

      default options: ['-files', '-settings', '-prefs']

restart_options

      Ruby type: Array

      default options: ['-agent', '-console', '-menu']

users

      Ruby type: Array

privs

      Ruby type: Array

      default: ['-all']

access

      Ruby type: String

      default: '-on'

allow_access_for

      Ruby type: String

      default: '-allUsers'

computerinfo

      Ruby type: Array

clientopts

      Ruby type: Array

action

      Ruby type: Symbol