-
-
Save AnneTheAgile/7a26c63b134c3b1214b6 to your computer and use it in GitHub Desktop.
--- | |
cache_dir: ~/Library/Caches/battleschool | |
# Originally, SpencerGibb: https://dl.dropboxusercontent.com/u/622216/battleschool/config.yml | |
# 2014-08-15Fri Change to AnneTheAgile | |
sources: | |
# local: | |
# - playbook.yml | |
url: | |
- name: playbook.yml | |
url: https://gist.githubusercontent.com/AnneTheAgile/28db99bd15718d2d1fe7/raw/24c8adff20191cbc27028128a9a3613711add9b1/talk-battle-playbook.yml | |
# https://www.dropbox.com/s/wcqanoxy1cg2o1c/playbook.yml | |
# was; url: https://www.dropbox.com/s/p55do4578af9q8f/playbook.yml | |
# was spencergibb: url: https://db.tt/VcyI9dvr | |
git: | |
- name: 'osx' | |
repo: 'https://github.com/spencergibb/ansible-osx' | |
playbooks: | |
- homebrew.yml #must come before any use of homebrew module | |
#- macports.yml #must come before any use of macports module | |
- vagrant.yml | |
- virtualbox.yml | |
- alfred.yml | |
- chrome-beta.yml | |
- dropbox.yml | |
#- intellij-idea-ultimate13.yml | |
- java7.yml | |
- java6.yml | |
- iterm2.yml | |
- macvim.yml | |
#- better-touch-tool.yml | |
#- adium.yml | |
#- github.yml | |
#- gitx.yml | |
#- libreoffice.yml | |
#- sequel-pro.yml | |
#- skype.yml | |
#- truecrypt.yml | |
#- usb-overdrive.yml | |
#- xtra-finder.yml | |
~/.battleschool files.
$ cat config.yml
---
cache_dir: ~/Library/Caches/battleschool
sources:
local:
- playbook.yml
# url:
# - name: playbook.yml
# url: https://db.tt/VcyI9dvr
git:
- name: 'osx'
repo: 'https://github.com/spencergibb/ansible-osx'
playbooks:
- homebrew.yml #must come before any use of homebrew module
#- macports.yml #must come before any use of macports module
- vagrant.yml
- virtualbox.yml
#- alfred.yml
#- chrome-beta.yml
- dropbox.yml
#- intellij-idea-ultimate13.yml
#- java7.yml
#- java6.yml
- iterm2.yml
#- macvim.yml
- better-touch-tool.yml
- adium.yml
#- github.yml
#- gitx.yml
#- libreoffice.yml
#- sequel-pro.yml
#- skype.yml
#- truecrypt.yml
#- usb-overdrive.yml
#- xtra-finder.yml
$ cat playbook.yml
---
- hosts: workstation
tasks:
- name: print from playbook
debug: msg="in playbooks/playbook.yml"
- name: easy install pip
easy_install: name=pip
sudo: yes
- name: install apps from pip
pip: name={{item}}
sudo: yes
with_items:
- virtualenv
- cliff
- pyyaml
- awscli
- name: install apps from homebrew
homebrew: name={{item}} state=present
with_items:
- coreutils
- git
- node
- maven
- rbenv
- dos2unix
- ruby
- tomcat
- wget
- ctags
- dnsmasq
# requires node/npm from above
- name: install global apps from npm
npm: name={{item}} global=yes
with_items:
- grunt-cli
# - name: create homdir symlinks
# file: src={{item.from}} dest={{item.to}} state=link
# sudo: no
# with_items:
# - from: ~/Dropbox/ubuntu/.bash_aliases
# to: ~/.bash_aliases
# - from: ~/Dropbox/ubuntu/.bash_logout
# to: ~/.bash_logout
# - from: ~/Dropbox/ubuntu/.bashrc
# to: ~/.bashrc
# - from: ~/Dropbox/mac/battleschool
# to: ~/.battleschool
# - from: ~/Dropbox/ubuntu/.ctags
# to: ~/.ctags
# - from: ~/Dropbox/ubuntu/.gitconfig
# to: ~/.gitconfig
# - from: ~/Dropbox/ubuntu/.inputrc
# to: ~/.inputrc
# - from: ~/Dropbox/ubuntu/.profile
# to: ~/.profile
# - from: ~/Dropbox/ubuntu/.todo
# to: ~/.todo
# - from: ~/Dropbox/ubuntu/.vimrc
# to: ~/.vimrc
# - from: ~/Dropbox/ubuntu/.zsh
# to: ~/.zsh
# - from: ~/Dropbox/ubuntu/.zshrc
# to: ~/.zshrc
# - from: ~/Dropbox/mac/bin
# to: ~/bin
# - from: ~/Google\ Drive
# to: ~/drive
# - name: install gems
# gem: name={{item}} state=latest
# with_items:
# - brewbygems
# - bundler
# - compass
# Bash Heredoc put into a file (not a variable)
$ cat <<EOF > myfile
> [workstation]
> localhost
> EOF
$ ls m*
myfile
# Ansible inventory file must exist and if use local, no ssh required
$ ansible all -m ping -i ansinv
localhost | success >> {
"changed": false,
"ping": "pong"
}
$ cat ansinv
[workstation]
localhost ansible_connection=local
# no ssh needed with local ansi connection, aka -c local, but couldn't get cli to work.
In this bootstrap, it uses ssh-copy-id which is not installed on mac, and then makes a user 'ansible' which perhaps defeats the value of having individual uids.
https://github.com/serenecloud/ansible-bootstrap/blob/master/ansible_bootstrap.sh
Erase disk partition, make mac os extended journaled.
From USB, run an osx 10.9.4 fresh install, taking 1.5hours.
No internet.
Login, turn on internet but no apple login.
Easy_install pip, with sudo.
Git exists but will not work due to no Xcode tools.
Run pip install battle school; get error about compile. Click OK to install Xcode dev tools.
Xcode itself remains uninstalled. No pkg found / seen. Clang is ok?
Do not need SSH for self, if follow above, must have inventory file.
Git clone works ok now on a public item.
[]get template config
Inventory file for localhost without SSH;
https://gist.githubusercontent.com/AnneTheAgile/cbd42fab4563ed1ae024/raw/75a1000f6f68774630289bbd6d8c36fd671bf873/talk-battle-inv.yml
Empty config that calls no play books for startup via bootstrapped;
https://gist.githubusercontent.com/AnneTheAgile/071ce60cc5205b133db4/raw/99fffb034158c39630617104d45ae69e730a98fc/talk-battle-config-empty.yml
Bootstrapper part 1, gets the environment var (not used yet, for SSH) and get the basic config.
https://gist.githubusercontent.com/AnneTheAgile/5e6666bd2e2c25890e1e/raw/0e1e2e542c84ab1e01101fe1651a6afd39b82240/talk-battle-ansi-config
$ ansible-playbook -i ansinv ansiboot.yml
PLAY [workstation] ************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [BattleSchool Hidden Folder is created.] ********************************
changed: [localhost]
TASK: [BattleSchool Configuration Initialization.] ****************************
changed: [localhost]
TASK: [Ensure git clone file gist worked.] ************************************
ok: [localhost]
PLAY RECAP ********************************************************************
localhost : ok=4 changed=2 unreachable=0 failed=0
[]Some SSH creation code is embedded in here;
https://github.com/serenecloud/ansible-bootstrap/blob/master/ansible_bootstrap.sh
[]Make an ad-hoc command line of this all ?
[]Run one each of real items?
[]Run get info on Dock etc.
At this point, after strategic deletion,
Normal Prep
Battleschool installs!
Normal see need a config.
Now with configs.
Blog ;
http://spencer.gibb.us/blog/2014/02/03/introducing-battleschool/
Main repo;
https://github.com/spencergibb/battleschool
Dependency repo;
https://github.com/spencergibb/ansible-osx