Category Archives: macOS

Install Ansible with ‘pip’ on macOS.

Published / by MasonCloud / Leave a Comment

Prerequisites:

  • Ensure Apple’s command line tools are installed (xcode-select --install to launch the installer).
  • Install Ansible (or simply see below instructions)

The preferred way to install ansible on a Mac is via pip.

Ansible can be installed via “pip”, the Python package manager. If ‘pip’ isn’t already available in your version of Python, you can get pip by:

$ sudo easy_install pip

Then install Ansible with pip:

$ sudo pip install ansible

Or if you are looking for the latest development version:

pip install git+https://github.com/ansible/ansible.git@devel

If you are installing on OS X Mavericks, you may encounter some noise from your compiler. A workaround is to do the following:

$ sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible

Readers that use virtualenv can also install Ansible under virtualenv, though we’d recommend to not worry about it and just install Ansible globally. Do not use easy_install to install ansible directly.

  • Clone repository (git clone https://github.com/masoncloud/mac-dev-playbook.git) to your local drive.
  • Run $ ansible-galaxy install -r requirements.yml inside this directory to install required Ansible roles.
  • Run ansible-playbook main.yml -i inventory -K inside this directory. Enter your account password when prompted.

Clear DNS cache in Linux/macOS & Win

Published / by MasonCloud / Leave a Comment

How to clear the local DNS cache:

macOS Sierra 10.12.0
sudo dscacheutil -flushcache ; sudo killall -HUP mDNSResponder ; say cache flushed
OSX 10.11.0
sudo killall -HUP mDNSResponder
OSX 10.10.4
sudo killall -HUP mDNSResponder
OSX 10.10.0 – 10.10.3
sudo discoveryutil mdnsflushcache
OSX 10.9  – 10.8 – 10.7
sudo killall -HUP mDNSResponder
OSX 10.5 – 10.6
sudo dscacheutil -flushcache
Windows
ipconfig /flushdns
Linux (depending on what you’re running)
/etc/init.d/named restart
/etc/init.d/nscd restart