Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

mtneug/ansible-modules-plist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Module for plists

This is an Ansible module for creating and manipulating plists.

Install

To install this module copy the library folder to the location of your playlist or role. The script makes use of biplist so make sure to install it on the targeted system.

- name: Install pip
  easy_install: name=pip
  sudo: yes

- name: Install python module dependencies
  pip: name=biplist
  sudo: yes

Usage

The module takes three arguments:

  • dest (Required): Either the absolute path of the plist, or a domain/filename which will be searched for in ~/Library/Preferences/<domain>.plist
  • key (Optional): The key of write the value to. If not given it is written to the root node.
  • value (Required): The value to write. It may be a string, int, float, boolean, array or dictionary. Nested dictionaries are allowed and are inclusive, i.e. nested keys that are only present in the current plist file will not be deleted.

This module supports check mode.

Example

- name: example 1
  plist_file:
    dest: /tmp/example.plist
    key: myString
    value: myValue

- name: Change Dock settings
  plist_file:
    dest: com.apple.dock
    value:
      # One of left, bottom, right
      orientation: left

      # Mission Control animation speed
      expose-animation-duration: 0.1

Limitations

  • The date and data types are not supported.

Tests

A simple test can be run with:

$ cd test
$ ./run.sh

License

This module is released under the MIT License.

About

Ansible module for managing plist files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published