LoginSignup
0
0

More than 5 years have passed since last update.

HARK をインストールした仮想環境を vagrant で作る (Ubuntu 16.04, HARK 2.3.0)

Posted at

なんの記事か

以前、HARK の環境を Vagrant で作る記事を書いた。
http://qiita.com/mzmttks/items/b6f45c97e662bd32eeb0

今回は、最新の環境での作り方を書く。ほとんど変更はない。

方法

ステップ 1

必要なファイルは次の二つ。これらを一つのディレクトリに入れて、そのディレクトリで vagrant up を実行する。
それぞれのファイルの中身は本記事の最後に書く。

  1. Vagrantfile
    vagrant の設定ファイル

  2. playbook.yml
    vagrant で仮想マシンを上げた後の設定。

ステップ 2

Vagrantfile で 192.168.33.10 と設定しているので、
ブラウザから http://192.168.33.10:3000 にアクセスすると
HARK Designer が立ち上がる。

ファイルの中身

Vagrantfile

# -*- 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/xenial64"
    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 "shell", inline: <<-SHELL
    apt install python -y
  SHELL

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

playbook.yml

- hosts: all
  become: yes
  tasks:
    - name: install python
      apt: name=python state=present force=yes

    - name: add HARK repository
      apt_repository:
        repo: 'deb http://archive.hark.jp/harkrepos xenial 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 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/lib/hark-designer
    - command: pm2 startup
    - command: pm2 save
0
0
0

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
0
0