Skip to content

Commit

Permalink
add run script for easier setup
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Dec 17, 2017
1 parent 0a729d8 commit c8ac231
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Basic starter kit to create your own provisioning

## Quick start

1. Clone this repo `git clone https://github.com/personal-provisioning/starterkit.git`
2. Delete the git folder `rm -rf .git/`
3. Init git again `git init`
4. Run `setup.sh`
1. Setup the directory strucutre: `mkdir -p ~/.personal_provisioning`
2. Clone this repo `git clone https://github.com/personal-provisioning/starterkit.git ~/.personal_provisioning/config`
3. Delete the git folder `rm -rf .git/`
4. Init git again `git init`
5. Have a look at `base.yml` and adjust it to your needs
6. Start the provisioning by running `ansible-playbook -i inventory base.yml`
6. Start the provisioning by running `./run.sh`

## How does this work?

`setup.sh` will create a few folders, install Ansible and pull our generic
`run.sh` will install dependencies such as Ansible and pull our generic
roles.

36 changes: 36 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

if [ ! -d ~/.personal_provisioning/roles ]; then
echo 'Cloning roles'
git clone git@github.com:personal-provisioning/roles.git ~/.personal_provisioning/roles
else
echo "Updating roles"
CURRENT_DIR=$(pwd)
cd ~/.personal_provisioning/roles && git pull --rebase && cd $CURRENT_DIR
fi

echo 'Installing XCode CLI Tools'
xcode-select --install || echo 'XCode CLI Tools are already installed'

which -s brew


if which -s brew
then
echo 'Updating Homebrew'
brew update --all && brew upgrade && brew cleanup
else
echo 'Installing Homebrew'
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

echo 'Installing Ansible'
brew install ansible


echo 'Running Ansible'

ansible-playbook -i "localhost," -c local base.yml

6 changes: 0 additions & 6 deletions setup.sh

This file was deleted.

0 comments on commit c8ac231

Please sign in to comment.