Coder Social home page Coder Social logo

tbridge / munki-in-a-cloud Goto Github PK

View Code? Open in Web Editor NEW
53.0 10.0 8.0 39 KB

A bash script designed to setup a Munki repository, download items, and then prepare and sync an Amazon S3 + CloudFront distribution method.

License: Other

Shell 87.78% HCL 12.22%
munki macos bash macadmins

munki-in-a-cloud's Introduction

munki-in-a-cloud

The goal of this script is to setup a basic munki repo with a simple script based on a set of common variables. I have placed defaults in these variables, but they are easily overridden and you should decide what they are.

This script is based upon Munki-in-a-Box, the Demonstration Setup Guide for Munki, AutoPKG, and other sources. My sincerest thanks to The Mac Admins Community for being supportive and awesome.

Pre-Requisites:

  1. A Mac running 10.12 or later.
  2. An active AWS Account and appropriate credentials
  3. A light understanding of CloudFront and S3.

Directions for Use:

As if this were a swarm of bees, unless you have some experience with Munki and AWS, this script may be dangerous. And, unlike Munki-in-a-Box, this script could cost you a substantial amount in storage fees, so use it carefully and deliberately. This script carries no warranty or guarantee, and it is entirely possible that Very Bad Things could happen by accident.

  1. Check variables in Lines 32-86
  2. Double-check that you have the right credentials in Lines 40-43
  3. ./miac.sh

If you do not make changes to the script before running it, the script may not run as intended. Please double-check to make sure that you are comfortable with the variables' values.

Caveats:

When you setup AutoPkgr, be sure to understand the security implications of giving that GUI app, and its associated launchdaemons, access to the keychain. You should really use a one-off account for those notifications, and not, say, the admin account to your Google Domain. Just sayin'.

Included Tools & Projects:

Munki

Munki is a client management solution for the Mac. I'm assuming you know a little bit about how Munki works by installing it via this script, but I would be remiss not to point you to Munki's official documentation. It is mostly installed in /usr/local/munki

MunkiAdmin

MunkiAdmin is Hannes Juutilainen's native GUI application for managing Munki repositories. It is super handy for those who prefer graphical interfaces to their inscrutable XML files. It is installed in the /Applications/Utilities directory.

AutoPkg

AutoPkg is an automated updates tool, used primarily from the command line, or through AutoPkgr, to keep a set of application installers up to date, and part of your Munki repository. AutoPkg is recipe-based, which means anyone can write their own recipe list and make it available. We are importing the main recipe repository, but if you want to add your own later, the AutoPkg docs will tell you how. Autopkg is installed in the /usr/local/bin directory.

AutoPkgr

AutoPkgr is the Linde Group's native GUI application used for managing AutoPkg's command line functionality. Specifically, you can configure it to periodically check for new updates, import those into your Munki repository, then email you about what new versions have been imported for testing. It is installed in the /Applications/Utilities directory.

AWS CLI

The Amazon Web Services Command Line Interface has a lot of useful tools for manipulating your AWS environment from the command line. I'm choosing to install it with pip, and installing pip if it is not already installed. You can alter that section if you want to use another package manager.

Changelog

New in 1.0

Major changes in the structure of this script arrive thanks to the inimitable Rich Trouton, who changes out some of manual code for proper functions, as well as modernization to several of the methods.

New in 0.1

Everything old is new again!

Questions? Comments? Suggestions? Jeers? Please email me at [email protected]

munki-in-a-cloud's People

Contributors

dials-mavis avatar mschwieger avatar rtrouton avatar tbridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

munki-in-a-cloud's Issues

S3 Bucket creation

The bucket creation with this script only works in AWS Region "us-east-1". All other AWS regions need the option --create-bucket-configuration LocationConstraint="$AWSREGIONID".

So it would have to be:
"$AWS" s3api create-bucket --acl private --bucket "$BUCKET" --region "$AWSREGIONID" --create-bucket-configuration LocationConstraint="$AWSREGIONID" --profile munki-in-a-cloud

However this does not seem to work with the "us-east-1" region.

AWS - s3api - create-bucket

License?

Could you please add an open source license to the project? Apache 2 would be a nice choice...

chmod vs chown

On line 453 of miac.sh, "chmod" should be "chown"

chmod -R "$ADMINUSERNAME" a+rX,g+w "$REPODIR"

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.