LoginSignup
3
3

More than 5 years have passed since last update.

HARK をインストールした仮想環境を vagrant で作る

Last updated at Posted at 2015-11-25

何をするのか

HARK をインストールした仮想環境を Vagrant で作った。

追記 (2015/11/29)
ソースからコンパイルする版を作った。
http://qiita.com/mzmttks/items/a8aa095712078b41f2fd

準備

  • vagrant をインストールする
  • 次のコマンドを実行
mkdir hark
cd hark

Vagrantfile  # 下記のファイルを作成
playbook.yml # 下記のファイルを作成

vagrant up

Vagrantfile

IP アドレスが重複している時は、 192.168.33.10 を別の何かに変える。

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure('2') do |config|

  config.vm.hostname = "hark"

  config.vm.provider "virtualbox" do |provider, override|
    override.vm.box = "ubuntu/trusty64"
    override.vm.network "private_network", ip: "192.168.33.10"
    override.vm.network :forwarded_port, host: 3000, guest: 3000

    # Display the VirtualBox GUI when booting the machine
    provider.gui = false

    # Customize the amount of memory on the VM:
    provider.memory = "1024"
  end

  config.vm.provision :ansible do |ansible|
    ansible.playbook = "playbook.yml"  # playbookファイル名
    ansible.host_key_checking = false
  end
end

Playbook

- hosts: all
  sudo: yes
  tasks:
    - name: add HARK repository
      apt_repository:
        repo: 'deb http://archive.hark.jp/harkrepos trusty non-free'
        state: present
    - name: upgrade system
      apt: upgrade=dist update_cache=yes
    - name: install HARK packages
      apt: name={{ item }} state=present force=yes
      with_items:
        - harkfd
        - hark-sss
        - hark-designer
        - hark-python
        - hark-binaural
        - hark-binaural+

    - name: install npm and nodejs
      apt: name={{ item }} state=present force=yes
      with_items:
        - npm
        - nodejs-legacy

    - name: install dependent packages
      shell: npm install
      args:
        chdir: /usr/bin/hark-designer

    - name: install pm2
      npm: name={{ item }} global=yes
      with_items:
        - pm2

    - name: run hark designer
      shell: pm2 start app.js --node-args "app.js allowremote"
      args:
        chdir: /usr/bin/hark-designer
    - command: pm2 startup
    - command: pm2 save
3
3
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3