How I setup several Macbooks while I sleep
Github.com/MWGriffin/ansible-playbooks is one of the first to use Ansible to install Macs. The last change was made in 2013. It provides playbooks for installation of php and others from zip file that may now be available as Homebrew packages. It copies from URLS such as into the /.ansible-downloads/ folder it creates. For Mac laptops: Run crc from command line. Download the latest version of the Ansible Tower installation bundle for OpenShift wget https://releases.ansible.com.
- Dot files and Ansible
- Dotfiles
- Inventory of Hosts
This is a hands-on tutorial for the fastest way to configure everything on your Mac for software developement, specific to what you want installed.
There are several categories:
- GUI desktop and apps
- Command-line profile and apps
GUI Manual config
VIDEO: Set Up OS X For Web Development in 10 Minutes [10:56] used these steps to customize a new Mac based on his notes on GitHub:
- Remove from Dock at the bottom of the screen
- [0:21] In System Preferences, General, Dark Menu
- [0:27] Dock, Automatically hide and show the Dock
- [0:31] Install Chrome browsesr, as default browser
- [0:48] Dropbox, 1Password, Alfred 2, Contexts, Sublime Text 3
- [1:51] Dropbox password file for 1Password
- [1:58] Command+Space key for Spotlight
- [2:09] Sublime Text configuration
- [2:44] iTerm, Command-line tools, Homebrew
- [3:32] Vagrant, Virtualbox
- [4:21] SQL Pro database, [4:32] Path Finder 7
- [5:09] Telegram messaging
- [5:20] App Store paid apps download Airmail, Slack, Navicat,
- [5:41] Transmit FTP, Tower Git client
- etc.
To practice, use a virtual machine (VMWare Fusion, Vagrant, or Virtualbox).
CLI for development config
- Homebrew
- brew install git
- ~/.bash_profile
- ~/.zsh
- brew cask install visual-studio-code
- code [editor to bring up folder and edit files]
- brew install curl jq
- cd / mkdir .ssh / cd .ssh / ssh-keygen
- Collaboration (Zoom, WebEx, etc.)
- Social media ()
Automate much?
If you’ve already run this, click here to skip to view and edit the install specifications further down this tutorial.
To automate preparation of third-party software for mass deployment onto managed clients:
- Autopkg at https://github.com/autopkg/autopkg (requies Git) aims to define the steps in a “Recipe” which can be defined in an understood (plist XML-based) format, run automatically instead of by hand, and shared with others.
- Software distribution server software: Munki (pronounced like “monkey”), Casper, Absolute Manage, etc.
There are two phases to this:
- Phase one - supply your password to install Xcode, Homebrew, Tap, and Cask, and Ansible
- Phase two - supply your password again for Ansible to install what is not commented out in specification files:
Dot files and Ansible
I haven’t seen it elsewhere on the internet, so I created an explanation of MacOS customizations and “dot files” that set them automatically.
- Copy from below this shell script call (highlight the line, then hold down command and press C to the invisible Clipboard):
- Make a folder and navigate into it:You can create another folder name if you prefer, but folder names in this tutorial will be wrong.
- In the Terminal window, paste the call from clipboard (hold down command and press V).
- Press the enter/return key to invoke the command whichcauses files to be downloaded and folders created:
- Xcode
- Homebrew, Tap, and Cask
- Ansible
The command also downloads folder laptop fromhttps://github.com/siyelo/laptop Antares autotune 7 mac os x free download.NOTE: Download and installation is skipped if it’s already installed. - When SUDO password: appears, hold down the control key and press C.This message should appear (in red):“[ERROR]: User interrupted executionfailed”
- While still in the Terminal window from above, change to the directory just created:cd laptop
pwdYou should now be at:Instead of “mac” above, it would show your account name. https://indian-casino-in-florida.peatix.com/.The siyelo playbook.yml file lists the applications to be loaded.The scripts/system_settings.sh file are commands to configure the Mac operating systemfor better security and productivity. It would take hours to set them all manually.
Mac Programs Google Sheet
Switch to use an internet browser to see my list of programs for Mac OSX at this Google spreadsheet online.
The _installer column identifies the technique to install to install each program named:
- brew (formulas) are installed using the brew command.Programs installed this way are invoked using a text-based Terminal command-line interface.
- tap uses the
brew tap
command to install a package within another repository. interesting brew tap. - cask packages are installed using the
brew cask
command which isan extension to Homebrew that allows management of applications with a graphical user interface (GUI). - pip are Python plug-ins.
- npm are Node modules (such as Express).
- store indicates manual installation using the Apple iTunes program accessing the Apple Store.
- zip programs are installed after a download, requiring an Ansible task to replace manual clicks and data entry.
WARNING: Each program added uses up more disk space.
WARNING: This may make obsolete documentation based on default Mac settings.
Ansible configurations are “idempotent”, which means that if you run it again, the result is the same. With declarative specifications, items specified for install are not re-installed.
The other columns in the spreadsheet:
_want contains Y for the generator to include in Ansible file.
Homebrew
Cask
Dotfiles
GitHub’s Dotfiles manage files containing preferences for command-line programs.
For example, the configuration file for Zsh is .zshrc.The SSH configuration folder is .ssh.And on.
Such files have a dot because they are hidden.
Famous collections of dotfiles from:
- https://github.com/holman/dotfiles from Zach Holman
- Matthias Bynens
- Paul Irish
- https://github.com/mattstauffer/ohmyzsh-dotfiles
Features added by dotfiles:
- Color grep output
- Boost ls commands
- Adding plugins to vim
Symlinks
Symlinks to files allow you to git pull and watch your dotfiles instantly update.
Onestores .ssh-config file in his Dropbox folder which he symlinks:
The .ssh-config file contains:
The above enables him to invoke:
No more remembering ip addresses, fumbling with command line switches for multiple SSH IDs, or even remembering your ssh usernames.
- https://mattstauffer.co/blog/setting-up-a-new-os-x-development-machine-part-3-dotfiles-rc-files-and-ssh-config
Edit playbook.yml
- Use the vi text editor program to edit the file:vi ~/gits/siyelo/laptop/playbook.yml
- To quit without editing type :q
- To save changes type :wq (colon, w, and q)
- To enter insert mode, press I.
- To escape insert mode, press the Esc key.
- Have a # (pound sign) in front of each package based on your evaluation.Click on each link to open a web page about each.Some links take you to a section lower in this tutorial.NOTE: The playbook.yml file contains code to run the system_settings.sh file.
Edit System Settings
- List the files and change directory into the scripts folder:ls -alcd scriptsThe above list the files and change directory into the scripts folder. https://site-3292137-6694-6595.mystrikingly.com/blog/adobe-acrobat-reader-pro-mac-free-download.
- Use the vi text editor program to edit the file:vi ~/gits/siyelo/laptop/scripts/system_settings.sh
- To quit without editing type :q
- To save changes type :wq (colon, w, and q)
NPM
- Search for packages at this site where resources are downloaded for install:
Example:
npm install -g yo
The
-g
globally installs for access from any folder.Find Ansible Version
Inventory of Hosts
The inventory of hosts can be defined within /etc/ansible/hosts containing .ini format Microsoft uses:
Items in square brackets define group names.
Alternately, a YAML format:
Other Ansible Playbooks
Consider other Ansible playbooks for Mac:
- github.com/MWGriffin/ansible-playbooks is one of the first to use Ansible to install Macs.The last change was made in 2013. It provides playbooks for installation of php and others from zip file that may now be available as Homebrew packages.It copies from URLS such as https://copy.com/8WKZ3x1ZWOIC/VLC-2.0.6.dmg?download=1 into the /.ansible-downloads/ folder it creates.
- Mr. Jeff Geeling I call “Master of the Ansible Galaxy” because he has contributed both the most downloaded roles and garnered the highest ratings. His mac-dev-playbook contains:
The requirements.txt file specifies files to download from the Ansible Gaxlaxy sharing site.
- geerlingguy.dotfiles sets up preferences and configurations for all the built-in services and apps.It references http://secrets.blacktree.com/?showapp=com.apple.finder
![Ansible mac os Ansible mac os](/uploads/1/2/6/6/126689194/755666532.png)
Use a text editor to edit the main.yml file at the root.Change user: value from “jgeeling” to your Mac account name.
Under the vars folder main.yml file is a list of several Homebrew packages.
Run Installation
- Open a Termial, go to the directory:cd ~/gits/siyelo/laptop/
- Run Ansible:ansible-playbook playbook.yml -i hosts –ask-sudo-pass -vvvv
- Press the return key to invoke the command.
- A restart is needed at the end.
Remove app
QUESTION: How to remove apps
Download Leisure Suit Larry: Reloaded for macOS 10.6.6 or later and enjoy it on your Mac. “Just as filthy, funny, and heartwarming as it ever was.' –Suzanne Keller, Slide to Play Score: 4 out of 4 “You might find Leisure Suit Larry: Reloaded the funniest thing you've ever seen and certainly a bit risque.” –Karl Burnett, TouchArcade. Leisure suit larry mac download. Just as filthy, funny, and heartwarming as it ever was.' Suzanne Keller, Slide to Play Score: 4 out of 4You might find Leisure Suit Larry: Reloaded the funniest.
Apple Store programs
Programs are installed into the Applications folder. Two different ones:
cd /Applications
cd ~/Applications
to see programs installed by clicking browser links, such as GoToMeeting, etc.
To get rid of the GarageBand music program, which comes with Apple MacOS:
- In a Terminal, go to where Apple stores its default apps at:The quotes are needed because there is a space in the folder name.
- See how much disk space it takes.The number of bytes is to the left of the date:
- PROTIP: Delete the contents, but leave the folder name.
Ansible Tower
Ansible Tower is a hub for automation tasks. It is a commercial product supported by Red Hat, Inc. but open sourced as AWX in September 2017 at https://github.com/ansible/awx.
An open source alternative to Tower is Semaphore, written in Go.
Others like this
The script described here was based on reviews of other similar “Mac booststrap” scripts:
- https://gist.github.com/zeekay/7394565
- https://github.com/fs/osx-bootstrapis a setup for Rails developement, includinghttp://fs.github.io/fs-tool/for creating pull-requests from command line and Ruby in Heroku.ImageMagick
- https://github.com/divio/osx-bootstrap also asks for RSA keys to GitHub
- https://github.com/monfresh/laptop provides a set of shell scripts.
Certification
Since Ansible was acquired by Red Hat, Inc. in October 2015, the company also controls certification and provides three training for it.
- AUTOMATION WITH ANSIBLE I (DO407) for $2,890 over 90 days or 4 days
- AUTOMATION WITH ANSIBLE II: RED HAT ANSIBLE TOWER (DO409) for $1,445 over 90 days
Resources
Red Hat’s YouTube channel has all products together.
https://code.tutsplus.com/tutorials/setting-up-a-mac-dev-machine-from-zero-to-hero-with-dotfiles–net-35449
To uninstall, select it and press Command+Delete or drag the program into the Trash.
http://osxdaily.com/2014/01/02/delete-garageband-imovie-iphoto-mac-os-x/
http://osxdaily.com/2014/01/01/4-free-os-x-utilities-mac/
https://www.ansible.com/videos-ansiblefest-sf-2016
More on OSX
This is one of a series on Mac OSX: Nmap mac download.
More on DevOps
This is one of a series on DevOps:
- Packer automation to build Vagrant images
- Terraform multi-cloud provisioning automation
- Hashicorp Vault and Consul to generate and hold secrets
I speak to a lot of people at a lot of user groups, Meetups (like the Melbourne PowerShell Meetup) or conferences and a lot of them seem to not have heard of Ansible yet. To be fair, Ansible is still very new to the Microsoft ecosystem and Microsoft is still quite new to the whole Configuration Management thing.
These people are instantly interested in what Ansible can do and usually ask me “so, how do I start?”
This obviously always depends on what type of person you are and how you learn. I for example need to actually use technology, otherwise I won’t understand it properly. Just reading about it doesn’t cut it for me.
This article will show you how to stand up an Ansible test lab in under 30 minutes.
I have already written about what Ansible is, so if you haven’t seen that article, find it here: Ansible - Windows Configuration Management from Linux
You will also find a link to Trond Hindenes’s website where he explains how to get started with Ansible.
Trond’s article is great to get you started, but it also takes quite a while to get everything setup and installed. This blog is all about automation, so it just makes sense to even automate the deployment of your next Ansible test lab, right?
The main idea about test labs that are mainly used for testing/validating code that you have just written is to spin them up easily and quickly and after having run all your tests you destroy it again.
Vagrant (https://www.vagrantup.com) is perfect for this scenario. Vagrant lets you, with only one line of code on the command line (PowerShell or Mac Terminal) deploy a whole test environment. Vagrant is available for download on Windows and Mac OS and supports all sorts of Hypervisors like Hyper-V, Virtualbox and Docker. There are also plugins available that add support to provision environments on AWS or Azure.
If you’re not sure why to use Vagrant, read this article: https://www.vagrantup.com/docs/why-vagrant/
Ansible Installation Guide
The great thing about Vagrant is that you describe your environment in just one file. Granted, it’s a ruby script, so you do need to make sure that syntax is right and maybe read a bit of the (by the way excellent) Vagrant documentation.
Because I am a nice guy I have already prepared a Vagrantfile that includes a Shell script that will install Ansible into the newly provisioned “box”.
Prerequisites
- Internet connection
- Virtualbox installed
- Vagrant installed
- optional: git client installed
Make it so
The following code will clone my Github repository hosting the two needed files to do the installation and then execute the provisioning.
Mac Ansible Config
If you don’t have a git client installed on your machine (why wouldn’t you???) then download the sources manually.
These four lines will create a new Linux server and will get Ansible and its prereqs installed onto the new server. The whole process will take approx. 10mins, depending on your internet connection.
vagrant ssh ansible will connect you to the new server via SSH (if you have SSH available on your machine or have configured Vagrant to use Putty (Windows)).
We are installing Ansible from source, so we need to run one more command to get Ansible working.
Ansible Install Package
source ansible/hacking/env-setup
Now you can start using Ansible. You will probably want to start adding more machines into your Vagrantfile to make sure that you will actually have an environment to test in. This is really easy. My test environment consists of the Ansible master server, an Ubuntu Ansible node and a Windows Server 2012 R2 Ansible node.
When I’m done I just call the following code and my environment is gone. No worries, because all my config and code is in source control anyways and gets automatically pulled in into each new environment I provision with Vagrant.
vagrant destroy
Enjoy your new toy!