Giter Site home page Giter Site logo

samdotci / ansible-macos-apps-install Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juju4/ansible-macos-apps-install

0.0 0.0 0.0 213 KB

setup a list of mac applications be it dmg or pkg format.

License: BSD 2-Clause "Simplified" License

Shell 75.82% Ruby 24.18%

ansible-macos-apps-install's Introduction

Actions Status - Master Actions Status - Devel

MacOS Applications installation ansible role

Ansible role to setup a list of mac applications be it dmg or pkg format. It is idempotent and will only update application if version is higher than current one (if relevant fields are present)

Requirements & Dependencies

Ansible

It was tested on the following versions: 1.9 to 2.11

Operating systems

Target MacOS 10.11, 10.12

soft requirements

GNUtar (gtar) is necessary instead of BSDtar (tar) if you will download non-zip compressed archives

brew install gnu-tar
export PTH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"

Example Playbook

Just include this role in your list. For example

- host: all
  roles:
    - juju4.macos-apps-install

Variables

See test/integration/default/default.yml for examples of applications installation.

target_user_id: "username"      # the name of the user we want the apps to belong to
verbose: False
install_archives: ~/Downloads
pip_path: /opt/local/bin/pip    # Homebrew's pip: /opt/local/bin/pip

macos_apps_install_list:
  - { u: 'https://download.mozilla.org/?product=firefox-50.1.0-SSL&os=osx&lang=fr',
      f: 'firefox-50.1.0-SSL-fr.dmg',
      v: True,
      s: '63c561051b1846f110ea60446a6578991a84d169e07dcfe1f4ea35aa4ca20e2a',
      n: 'Firefox',
      t: 'app',
      version: '50.1.0'
    }
    - { u: 'http://dl.paragon-software.com/demo/ntfsmac15_trial.dmg',
      f: 'ntfsmac15_trial.dmg',
      n: 'NTFS for Mac',
      m: '/Volumes/ParagonFS.ntfs',
      t: 'installer',
      exec_name: 'FSInstaller.app'
    }
  - { u: 'https://some.app.com/download/link', # REQUIRED # Archive Download URL
      f: 'archive_file.dmg',                   # REQUIRED # Archive File Name (how it will be saved with)
      n: 'My Fancy App',                       # REQUIRED # Name of the application also used for the .app file
      exec_name: '',                           # OPTIONAL # Name of the installed file if it is not an .app
      env: '',                                 # OPTIONAL # Environment variables required by the installer
      version: '1.0.2',                        # OPTIONAL # Required Application Version
      t: 'app',                                # OPTIONAL # Installer type
      m: '/Volumes/My Fancy App',              # OPTIONAL # Name of the archive mount point when different than application name or when wanting a custom name
      to: '/Applications',                     # OPTIONAL # Destination name for the application
      versioncmd: '',                          # OPTIONAL # Specific command to retrieve the currently          installed application version
      plist_tag: '',                           # OPTIONAL # Plist tag that identify the application version
      v: True,                                 # OPTIONAL # Toggle file integrity verification after download
      s: '63c5610...a20e2a',                   # OPTIONAL # Checksum value for file integrity verification
    }

Notes on Variables

Installer Types: t:

default: app

  • app: .app file contained in a DMG archive
  • installer: .app/exec interactive installer contained in a DMG file
    • requires the use of exec_name: to define the name of the installer file
  • pkg: .pkg installer contained in a DMG file
  • pkgonly: .pkg installer NOT contained in a DMG or compressed archive
  • zip|compressed_archive: application contained in any kind of compressed archive

Exec Name: exex_name

This is the name of the script or binary contained in the archive in case it is not a ".app":

  • a script (i.e. script.sh)
  • a no-extension binary (i.e. my_executable)
  • an installer packages (i.e. installer.pkg).

Version: version:

If you do not specify a version number the application will always install and overwrite any existing version.

When a specify a version number is specified:

  • the application will be installed if the currently installed version is older
  • the application will NOT be installed if the currently installed version is newer

Version Command: versioncmd:

default: /usr/libexec/PlistBuddy -c 'print :<plist_tag>' '/path/to/App/Contents/Info.plist'

This is a command specific to the application to retrieve the currently installed version in case the default command will not be adequate.

Plist Tag: plist_tag:

default: CFBundleShortVersionString

This is the tag that identify the application version inside the its .plist file

Environments: env

Allows to pass environment variables (i.e. API_key ) required for the installer customisations.

Example:

env: "env API_KEY={{ prey_apikey | default('') }}"

See: http://help.preyproject.com/article/188-prey-unattended-install-for-computers

Continuous integration

This role has a GitHub Action pipeline.

Troubleshooting & Known issues

Alternatives

License

BSD 2-clause

ansible-macos-apps-install's People

Contributors

dependabot[bot] avatar juju4 avatar marcomc avatar samdotci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.