Giter Club home page Giter Club logo

devops-singapore-2016's Introduction

DevOpsDays Singapore 2016 Ansible Workshop Preparation

Introduction

While the workshop should be informative and useful if you can't run Ansible on the day, being able to try commands as we go along will likely aid memory and allow more interaction.

If the instructions below aren't clear, please raise an Issue (or better still a Pull Request) against thse instructions.

Requirements

  • One control node - this can be your laptop if you're running OS X or Linux. The control node should have the following installed:
    • ansible 2.1
    • git
  • One target node - this should probably be a fresh VM on your laptop. The accompanying playbooks will run best against Fedora/CentOS/RHEL etc. but require minor tweaks for Debian/Ubuntu etc. The target host should have a local account that you can ssh as without password using SSH keys, and that acount should be able to sudo as root without password.

Easy setup

This is intended for people who are running windows or who want a simple way to create the necessary VMs.

Ensure hardware virtualization is enabled

For Windows/Linux on 64 bit CPUs (32 bit CPUs are not supported in this doc at this point, improvement suggestions welcomed)

Most Apple Macs have hardware virtualization on by default, so no action should be required.

Install Virtualbox and vagrant

OS X, Windows
Fedora, Ubuntu etc.

Download the workshop resources

Download and extract: https://github.com/willthames/devops-singapore-2016/archive/master.zip

Create VMs

From the workshop resources directory (on Windows, Shift+Right Click on a folder will give you an option to open a command prompt in that directory), run:

cd vagrant
vagrant up --provision target
vagrant up --provision control
vagrant reload --provision target

on the command line. (The order here allows the control node to get its ssh key onto the target, before turning off password access on the target node again)

Troubleshooting

If you see:

The box 'centos/7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/centos/7"]
Error:

you may need to install Visual C++ runtime (see hashicorp/vagrant#6754)

Check that first VM can control second VM

On windows, if you don't already have a command-line ssh client, download and install git from https://git-scm.com/downloads. When installing, ensure that the 'Git Bash here' option is ticked.

From the workshop resources directory (use Shift + Right click to get Git Bash here on the folder in windows), run:

vagrant ssh control

From the control node, run:

ansible -m ping target
ansible -m command -a whoami -b target

Self installation

On your control node:

cd workingdir
git clone https://github.com/willthames/devops-singapore-2016
cd devops-singapore-2016/ansible
TARGET=_INSERT_IP_ADDRESS_OF_TARGET_HOST_HERE_
USER=_INSERT_USERNAME_FOR_TARGET_HOST_HERE_
echo > inventory/target << EOF
[web]
target ansible_host=$TARGET ansible_user=$USER
EOF

Then the following should work

ansible -m ping target
ansible -m command -a whoami -b target

devops-singapore-2016's People

Contributors

willthames avatar

Watchers

 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.