Giter Site home page Giter Site logo

alfalfa's Introduction

alfalfa

This is an experimental project for provisioning new development machines.

Alfalfa seeks a middle ground between sprout-wrap, which relies on Chef, and workstation-setup, which uses shell scripting.

Usage

Depending on how you feel about cows, you might find it useful to export ANSIBLE_NOCOWS=1 first.

Local Provisioning

bash <(curl -s https://raw.githubusercontent.com/seattle-beach/alfalfa/master/bootstrap.sh)
cd ~/workspace/alfalfa/ansible
ansible-playbook main.yml --ask-become-pass --connection=local

You will need to type yes a couple of times due to SSH known_hosts schenanigans until our playbook gets around to fixing it.

Notes

The base Alfalfa playbook (main.yml) balances having a base set of tools for a workstation with the amount of time required to run. As such, there are some other playbooks included with Alfalfa that can be installed to finish customizing a new install:

  • java.yml
  • ruby.yml
  • postgres.yml
  • xcode.yml
  • arkit.yml

Running a single playbook

To run an individual playbook, go into the ansible directory and run the ansible command like this:

pushd ~/workspace/alfalfa/ansible
ansible-playbook arkit.yml --ask-become-pass
popd

Sierra does not allow modifying TCC.db without jumping through significant hoops, so you'll need to manually enable apps that require accessibility access (e.g., ShiftIt).

Remote Provisioning

First, the remote machine needs to agree to the sudo disclaimer:

sudo -v && sudo -k

Then, on the control machine:

brew install ansible

git clone https://github.com/seattle-beach/alfalfa
cd alfalfa/ansible
echo HOST > hosts
ansible-playbook main.yml --ask-pass --ask-become-pass

Troubleshooting

fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host localhost port 22: Connection refused", "unreachable": true}

Append --connection=local to the playbook runner. So, instead of

ansible-playbook main.yml --ask-pass --ask-become-pass

use

ansible-playbook main.yml --ask-pass --ask-become-pass --connection=local

alfalfa's People

Contributors

sgravrock avatar tanglisha avatar kejadlen avatar alidaka avatar sentientmonkey avatar slackersoft avatar mattk-vmw avatar bspeck avatar loktar avatar osafi avatar sarahwalther avatar

Stargazers

Rowan Jacobs avatar Arthaey Angosii avatar Clayton Hynfield avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Michael Martell avatar

alfalfa's Issues

Cows are missing

Cowsay isn't used even if ANSIBLE_NOCOWS is unset. It looks like we're not installing cowsay early enough in the process.

Continue running playbook if files already exist

I ran ansible-playbook main.yml --ask-pass --ask-become-pass on a machine that had a few things set up already (bash-it, vimrc, etc). It stopped with an error on each one, so I had to move the files out of the way to keep running the setup without spending too much time troubleshooting.

It would be nice if there were a --force option to overwrite, or a --continue option to ignore and keep going.

OpenSSL linking now that Apple doesn't provide it

It took me a while, but I think I've figured out how to everything to work, but I'm not sure how to get ansible to add an environment variable (probably in to bash_it somewhere).

I think we want to add PKG_CONFIG_PATH and set it to the lib/pkgconfig dir under whichever openssl has just been installed.

Probably something like

PKG_CONFIG_PATH=/usr/local/Cellar/openssl/$(ls /usr/local/Cellar/openssl/ | tail -1)/lib/pkgconfig

Should we drop all the bash-it stuff

Now that we're imaging to OS' with zsh instead and we have that configured, is there any reason to be including all the old bash-it related configuration?

clear flycut history every day

Save the following as /usr/local/bin/clear-pasteboard and make it executable:

#!/usr/bin/env bash
set -euo pipefail

FLYCUT_PATH="/Applications/Flycut.app"
FLYCUT_CONF="${HOME}/Library/Application Support/Flycut/com.generalarcade.flycut.plist"

if [ -d "$FLYCUT_PATH" ] ; then
  set +o pipefail
  pid=$(ps aux | grep Flycut.app | grep -v grep | awk '{print $2}')
  set -o pipefail

  # if Flycut is running, kill it. else it will keep and persist current history...
  if [ "${pid}" != "" ] ; then
    kill ${pid}
    sleep 10
  fi

  # empty the Flycut history "store"...
  plutil -replace 'store.jcList' -json '[]' "${FLYCUT_CONF}"

  # if Flycut *was* running, restart it...
  if [ "${pid}" != "" ] ; then
    open "${FLYCUT_PATH}"
  fi
fi

Save the following as ~/Library/LaunchAgents/io.pivotal.clear-pasteboard.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
<dict>
    <key>Label</key>
    <string>io.pivotal.clear-pasteboard</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/clear-pasteboard</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>00</integer>
    </dict>
</dict>
</plist>

Execute: launchctl load -w ~/Library/LaunchAgents/io.pivotal.clear-pasteboard.plist

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.