toozej / ansible

Ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Home Ansible Setup

CI

What is it

Ansible is a fantastic configuration management system that I use to self-provision servers & VMs. Currently I have Ansible run itself locally on a server during provisioning/bootstrapping only, but I have plans to also have Ansible update itself (by pulling this repo) and running against localhost periodically using Cron.

How to use it

  • scp private SSH key into ~/.ssh/
  • grab bootstrap.sh
curl https://raw.githubusercontent.com/toozej/ansible/master/bootstrap.sh -O && chmod +x bootstrap.sh
  • check the playbook: sudo ./bootstrap.sh -c $playbook_name.yml
  • run the playbook: sudo ./bootstrap.sh -r $playbook_name.yml

Or if you would rather just automatically run the common playbook as a minimal install:

curl https://raw.githubusercontent.com/toozej/ansible/master/minimal.sh -O && chmod +x minimal.sh && ./minimal.sh

Or if you would rather just run one playbook stand-alone:

  • cd /tmp/ansible; ansible-playbook $playbook_name.yml

Or if you want to run a playbook stand-alone skipping tags:

  • cd /tmp/ansible; ansible-playbook $playbook_name.yml --skip-tags $tag_name,$tag_name2

Or if you want to run a playbook straight from the repo directory:

  • sudo ANSIBLE_ROLES_PATH=/home/james/src/github/toozej/ansible/roles ansible-playbook playbooks/simplenote-only.yml

Useful info for developing Ansible

Setting up Pre-commit hooks

From the root of this repo, run the following commands:

  • sudo pip install pre-commit
  • pre-commit install
  • pre-commit autoupdate
  • commit any changes made, and ensure that pre-commit functions as expected
  • push like usual

About

Ansible

License:GNU General Public License v3.0


Languages

Language:Jinja 77.5%Language:Shell 17.0%Language:Ruby 5.5%