Return to site

Ansible Download For Mac

broken image


  • Defining Ansible Playbooks. The approach I have taken is to define playbooks for different applications and included all these playbooks in the main playbook. Each playbook is called from the main playbook which downloads the application from the web and then executes the set of codes depending on the type of file downloaded using roles in Ansible.
  • If you are a new customer, register now for access to product evaluations and purchasing capabilities. Need access to an account? If your company has an existing Red Hat account, your organization administrator can grant you access.

How I setup several Macbooks while I sleep

  • Dot files and Ansible
  • Dotfiles
  • Inventory of Hosts

Edit the Ansible Tower inventory file and set the following variable to the PVC name: openshiftpgpvcname=postgresql; Option 2b: Tower Managed Database, with Non-Persistent Data. With this option, PostgreSQL is installed by the Tower installer in OpenShift using an emptyDir volume that Tower creates for you. More info can be found here. For this option, you need to set the following. How to provision AWS EC2 instances using ansible playbook. Create, launch, start, stop and terminate instances using tags and instance id with ec2 module.

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.

Ansible Apt Install

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

  1. Homebrew
  2. brew install git
  3. ~/.bash_profile
  4. ~/.zsh

  5. brew cask install visual-studio-code
  6. code [editor to bring up folder and edit files]

  7. brew install curl jq

  8. cd / mkdir .ssh / cd .ssh / ssh-keygen

  9. Collaboration (Zoom, WebEx, etc.)
  10. 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:

Ansible Installation Guide

  1. Phase one - supply your password to install Xcode, Homebrew, Tap, and Cask, and Ansible

  2. Phase two - supply your password again for Ansible to install what is not commented out in specification files:

Dot files and Ansible

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.

  1. Copy from below this shell script call (highlight the line, then hold down command and press C to the invisible Clipboard):

  2. 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.

  3. In the Terminal window, paste the call from clipboard (hold down command and press V).
  4. 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

    Dialux for mac free download. NOTE: Download and installation is skipped if it's already installed.

  5. When SUDO password: appears, hold down the control key and press C.This message should appear (in red):

    '[ERROR]: User interrupted executionfailed'

  6. While still in the Terminal window from above, change to the directory just created:

    cd laptop
    pwd

    You should now be at:

    Instead of 'mac' above, it would show your account name.

    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.

Guide

I haven't seen it elsewhere on the internet, so I created an explanation of MacOS customizations and 'dot files' that set them automatically.

  1. Copy from below this shell script call (highlight the line, then hold down command and press C to the invisible Clipboard):

  2. 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.

  3. In the Terminal window, paste the call from clipboard (hold down command and press V).
  4. 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

    Dialux for mac free download. NOTE: Download and installation is skipped if it's already installed.

  5. When SUDO password: appears, hold down the control key and press C.This message should appear (in red):

    '[ERROR]: User interrupted executionfailed'

  6. While still in the Terminal window from above, change to the directory just created:

    cd laptop
    pwd

    You should now be at:

    Instead of 'mac' above, it would show your account name.

    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

  1. 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.
  2. 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. Download ivms 4500 for mac.

    NOTE: The playbook.yml file contains code to run the system_settings.sh file.

Edit System Settings

  1. List the files and change directory into the scripts folder:

    ls -alcd scripts

    The above list the files and change directory into the scripts folder.

  2. 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

  1. 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.

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

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

  1. Open a Termial, go to the directory:

    cd ~/gits/siyelo/laptop/

  2. Run Ansible:

    ansible-playbook playbook.yml -i hosts –ask-sudo-pass -vvvv

  3. Press the return key to invoke the command.

  4. A restart is needed at the end.

Remove app

QUESTION: How to remove apps

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:

  1. 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.

  2. See how much disk space it takes.

    The number of bytes is to the left of the date:

  3. Microsoft internet explorer 8 download for mac. 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:

More on DevOps

This is one of a series on DevOps:

  1. Packer automation to build Vagrant images
  2. Terraform multi-cloud provisioning automation
  3. Hashicorp Vault and Consul to generate and hold secrets

Please enable JavaScript to view the comments powered by Disqus.function google_search(){ window.location = 'http://www.google.com/search?q=site:+' + encodeURIComponent(document.getElementById('q').value);}

This extension includes a build/release task to integrate with Ansible. The task executes a given Ansible playbook on a specified list of inventory nodes via command line interface.Ansible is an open-source IT automation engine that can configure systems, deploy software and orchestrate application deployments.Ansible uses Playbooks which express configurations, deployment, and orchestration steps in YAML format. Each Playbook maps a group of hosts to a set of roles. Each role is represented by calls to Ansible tasks.Inventory file is a description of the nodes that can be accessed by Ansible.

This task requires that the Playbook and Inventory files be located either on a private Linux agent or on a remote machine where Ansible automation engine has been installed. Additionally Inventory can also be specified inline or as a Host list.

Prerequisites

Install Ansible automation engine

Follow the installation guidance to install Ansible on a private Linux agent or on a remote machine. Currently Ansible can be run from any machine with Python 2.6 or 2.7 installed (Windows isn't supported for the control machine).

Create an SSH endpoint

If Ansible is installed on a remote machine, you would need to set up an SSH endpoint in the administration section of your VSTS project.

  • The hostname or IP address of the remote machine, the port number, and the user name are required
  • The private key and the passphrase must be specified for authentication.
  • A password can be used to authenticate to remote Linux machines, but this is not supported for Mac or OSX systems.
  • The public key must be pre-installed or copied to the remote machine.

Task

Installing the extension adds the following Ansible task which runs a given Playbook:

When Ansible automation engine is located on an Agent machine:

When Ansible automation engine is located on a remote machine:

Task arguments

  • Ansible location: Location where Ansible automation engine is installed. Can be either a private agent machine or a remote machine. Ansible communicates with remote machines over SSH and would require the SSH endpoint details.

  • SSH endpoint*: Name of the SSH service endpoint containing connection details for the remote machine where Ansible automation engine has been installed.

  • Playbook Source: Choose agent machine if playbook is part of a linked artifact and should be copied to the remote Ansible machine. Otherwise, select Ansible machine.

  • Playbook root*: Specify the working directory path where playbook and associated files are located on the agent machine. All the files in this folder will be copied to Ansible machine.

  • Playbook file path*: Specify the path to the playbook file to be executed on the Ansible machine. Playbooks declare Ansible's configuration, deployment, and orchestration steps in YAML format.

  • Inventory location: By default, Ansible Inventory is described by a configuration file, in INI format, whose default location is in /etc/ansible/hosts. Inventory can also be specified as a separate configuration file which lists either the IP address or hostname of each node that is accessible by Ansible. Or can be specified as a Host list of comma separated hosts. Example - foo.example.com, bar.example.com.

Alternatively Inventory can be specified inline.

  • Inventory file path*: Specify the path to inventory host file on Ansible/Agent machine

  • Dynamic Inventory: Ansible can also use a custom Dynamic Inventory script, which can dynamically pull data from a different system. Check this box if dynamic inventory is used.

  • Advanced - Sudo: Run operations with sudo. It works only when the Ansible user is sudoer with nopasswd option.This also requires desired sudo user name. 'root' is used when this field is empty.

  • Additional arguments: The arguments to pass to Ansible command line. Refer to documentation on Ansible Commands Modules and Ad-Hoc Commands

  • Advanced - Fail on STDERR: If this option is selected (the default), the build will fail if the remote commands or script write to STDERR.

  • Control options: See Control options

Contact Information

For further information or to resolve issues, contact Developer Community Forum.





broken image