Coder Social home page Coder Social logo

vagrant-ansible-serverspec's Introduction

vagrant-ansible-serverspec

Build Status

AnsibleServerspec を利用できる最低限の環境を、VirtualBox 上に Vagrant を用いて構築する。

プロキシサーバが存在する企業内LANで、ホストOSがWindowsであることを想定している。

準備

Windowsの環境設定で環境変数に自身の環境に合ったproxyの値を設定する。

変数名
http_proxy http://proxyhost:proxyport/
https_proxy http://proxyhost:proxyport/

Gitが入っているのであれば tenten0213/vagrant-ansible-serverspec をcloneする。

入っていない場合はDownload ZIPからzipファイルを取得し、任意の場所に解凍する。

VirtualBoxのインストール

VirtualBoxのダウンロードページ から利用環境に合ったインストーラをダウンロードし、インストールする。

Vagrantのインストール

Vagrantのダウンロードページ から利用環境に合ったインストーラをダウンロードし、インストールする。

Vagrantのproxy設定

ゲストOSにProxyの設定をしてくれるVagrantプラグインをインストールする。

$ vagrant plugin install vagrant-proxyconf
$ vagrant plugin list
vagrant-proxyconf (1.2.0)

vagrant-ansible-serverspec/Vagrantfile の以下の箇所を、自身の環境に合ったproxy設定に修正する。

config.proxy.http = "http://proxyhost:proxyport/"
config.proxy.https = "http://proxyhost:proxyport/"

仮想マシンの起動

vagrant-ansible-serverspec配下に移動し、以下のコマンドを実行する。

$ vagrant up

仮想マシンの状態を確認するには以下のコマンドを実行する。

$ vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

仮想マシンをシャットダウンしたい場合は以下のコマンドを実行する。

$ vagrant halt

仮想マシンにアクセスし、動作確認する

MacやLinuxがホストの場合はvagrant sshで接続可能だが、Windowsの場合はsshクライアントを利用するのが良い。

以下にTera Termを利用した場合の例を載せる。

teraterm

ユーザ/パスワードは共にvagrant

authentication

OKを押すと接続される。

connected

AnsibleとServerspecがインストールされているか確認する。(2015/06/01時点)

$ gem list
gem list

*** LOCAL GEMS ***

diff-lcs (1.2.5)
multi_json (1.11.0)
net-scp (1.2.1)
net-ssh (2.9.2)
rake (10.4.2)
rspec (3.2.0)
rspec-core (3.2.3)
rspec-expectations (3.2.1)
rspec-its (1.2.0)
rspec-mocks (3.2.1)
rspec-support (3.2.2)
serverspec (2.17.0)
specinfra (2.34.4)

$ ansible --version
ansible 1.9.1
  configured module search path = None

vagrant-ansible-serverspec's People

Contributors

tenten0213 avatar progre avatar garbagetown avatar

Watchers

James Cloos avatar  avatar

Forkers

anveshkumarm

vagrant-ansible-serverspec's Issues

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.