Giter VIP home page Giter VIP logo

ansible-control's Introduction

Ansible Control

This is a Vagrant/Virtualbox set of scripts for experimenting with Ansible in a disposable/recreatable environment.

Install

Vagrant is very finicky software, but these versions seem to work for this setup, while newer versions don't. When the newer versions have the bugs ironed out, I hope to upgrade these links.

  • Install prereqs (Windows 7):

  • Download (or clone this repo).

  • cd <directory of this repo>

  • vagrant up

That will build two boxes- ansible-control and target. ansible-control has Ansible installed, this repo on it, and some other light provisioning (see ./ansible_control.yaml ). target1 is a blank slate. It will take quite a while to download, import, and provision the boxes, so get a coffee.

If you get a VirtualBox error, try it again and then try uninstalling your Virtualbox and updating to a newer version. Maybe that will help.

  • From Windows, SSH to 127.0.0.1 port 2222 with username vagrant and password vagrant
  • From ansible-control, ssh to target1 with username vagrant and password vagrant to add the key to the known_hosts list.
  • type exit to exit target1
  • type cd ~/ansible_control to change directories to where your ansible files are.

Test

ansible -i hosts -k -m ping all

Use

Now you should be able to start writing playbooks and testing them against target1 (and ansible-control if you want)

Learn

  • Ansible
  • Vim
    • Vim is a text editor that I use to write playbooks. To go through the tutorial, type vimtutor in the console.
  • Linux - this is just a link to a tutorial I found online. There are others, and randomly googling is helpful here too. If you need help for a specific command, type man <command> to pull up the manual. If you don't know the command, type man -k <keyword> to search the man pages. Googling is generally faster though.

Saving your work outside the VM

Virtualbox and Vagrant offer ways to sync folders, but I haven't been able to get any of them to work reliably on Windows. Instead I use a git repo to save my work.

Shut down

When you're done for the day, type vagrant halt from Windows to kill the VM. Type vagrant up to restart it.

Destroy

If you screw something up or you want to start over, make sure your work is saved and type vagrant destroy to destroy the VM. To create a new one, type vagrant up again.

TODO

  • Set up synced folder for ansible projects (probably won't fix)
  • Use SSH keys instead of passwords so I don't have to use -k

ansible-control's People

Contributors

bbkane avatar

Watchers

 avatar  avatar  avatar

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.