charliemaiors.shinobi

Shinobi

ビルドステータス

Shinobiロールは、Ubuntu、CentOS、またはArchlinuxシステムにShinobi CCTVシステムをデプロイします。変数を使用することで、CE版またはPro版をデプロイすることが可能です。

要件

このロールの要件は、NodejsとnpmFFMPEGです。また、shinobiデータベースとスキーマがすでに作成された状態で、MariaDB/Postgresのインスタンスが稼働している必要があります。これをshinobi-dbロールを使用してデプロイすることも可能です。

ロール変数

このロールには主に3つの変数が必要です(子ノードの場合は別です。クラスタリングを参照):

db_host: "localhost"
shinobi_pass: "test"
shinobi_port: "8080"

db_host変数はshinobiデータベースのアドレスで、ロールはすでに作成されて設定されていることを前提としています。アドレスが間違っている場合、ロールは失敗しませんが、Shinobiは動作しません。 shinobi_pass変数は、データベースに接続するためのshinobiバックエンドサービスのパスワードです。 shinobi_port変数はポートです。

デフォルトの変数は次のとおりです:

random_key: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}"
ce_version: "https://gitlab.com/Shinobi-Systems/ShinobiCE.git"
pro_version: "https://gitlab.com/Shinobi-Systems/Shinobi.git"
ce: true
pro: false
lts: true
startup: true
shinobi_user: "shinobi"
shinobi_version: "HEAD"
dbhash: "md5"

random_key変数はランダムなパスワード生成に使用されます。ce/pro_versionはコミュニティおよびプロ版のためのShinobiコードリポジトリへの参照です。ce/proフラグは、ダウンロードするバージョンを定義します。ltsフラグは、ノードのバージョンをインストールするために使用され、sqliteの依存関係をインストールしないようにします(Node.js v8ではnpmからのsqliteインストールが失敗します)。 shinobi_userはデフォルトのshinobiユーザー名で、dbhashはパスワード保管に使用されるハッシュアルゴリズムです(依存関係セクションを参照)。shinobi_versionは、shinobiリポジトリからクローンするコミットハッシュまたはブランチです。

クラスタリング

子ノードの導入に伴い、定義できる2つの追加変数があります。

cluster: true or false
cluster_role: "child" or "master"

cluster_roleが子に設定されている場合、master_keymaster_ipも提供する必要があります。

依存関係

このロールはnodejsおよびffmpegロールに直接依存しています。また、Mysql/Mariadbおよびshinobiスキーマ定義に間接的に依存しています。直接の依存関係リストは以下の通りです:

  • charliemaiors.nodejs(ltsフラグはnodejsロールにも適用され、どのバージョンをインストールするかを決定します)
  • charliemaiors.ffmpeg

間接的な依存関係はcharliemaiors.shinobi-dbにあり、共通変数としてshinobi_usershinobi_passが使われます。また、db_host変数はデータベースホストマシンのアドレスを使用して決定することが可能です(同じマシンの場合はlocalhostでもかまいません)。

例プレイブック

これはオールインワンインストールの例です:

  - name: シノビを単一ホストにデプロイ
  hosts: shinobi-all-in-one
  vars:
    shinobi_pass: "shinobi-test-machine"
    db_host: "localhost"
    shinobi_port: "8080"
    user_pass: "shinobi-test"
    user_mail: "[email protected]"
    dbhash: "sha256"
    startup: true
    ce: false
    pro: true
    lts: true
  roles:
    - charliemaiors.nodejs
    - charliemaiors.ffmpeg
    - charliemaiors.shinobi-db
    - charliemaiors.shinobi

これは異なるマシンにデータベースを配置した例です:

-- name: シノビデータベースをデプロイ
  hosts: shinobi-db
  roles:
    - { role: charliemaiors.shinobi-db, shinobi_pass: "shinobi-test-machine", user_pass: "shinobi-test", user_mail: "[email protected]"}

- name: シノビフロントエンドをデプロイ
  hosts: shinobi-fe
  roles:
    - charliemaiors.nodejs
    - charliemaiors.ffmpeg
    - { role: charliemaiors.shinobi,  db_host: "{{ hostvars[groups['shinobi-db'][0]].ansible_host }}", shinobi_port: "8080", user_pass: "shinobi-test", user_mail: "[email protected]", shinobi_pass: "shinobi-test-machine", startup: true, ce: false, pro: true }

これは異なるマシンにデータベースを配置し、子ノードも持つ例です:

- name: シノビデータベースをデプロイ
  hosts: shinobi-db
  roles:
    - { role: charliemaiors.shinobi-db, shinobi_pass: "shinobi-test-machine", user_pass: "shinobi-test", user_mail: "[email protected]"}

- name: シノビマスターをデプロイ
  hosts: shinobi-master
  roles:
    - charliemaiors.nodejs
    - charliemaiors.ffmpeg
    - { role: charliemaiors.shinobi,  db_host: "{{ hostvars[groups['shinobi-db'][0]].ansible_host }}", shinobi_port: "8080", user_pass: "shinobi-test", user_mail: "[email protected]", shinobi_pass: "shinobi-test-machine", startup: true, ce: false, pro: true, cluster: true, cluster_role: "master", master_key: "test" }

- name: シノビ子ノードをデプロイ
  hosts: shinobi-childs
  roles:
    - charliemaiors.nodejs
    - charliemaiors.ffmpeg
    - { role: charliemaiors.shinobi,  master_ip: "{{ hostvars[groups['shinobi-master'][0]].ansible_host }}", cluster: true, cluster_role: "child", master_key: "test" }

ライセンス

GNU GPL

著者情報

このロールは、2018年にCarlo Maioranoによって、Dipartimento di Informatica - Scienza e Ingegneria of Alma Mater Studiorumの開発者として作成されました。監督はグループリーダーのPaolo Bellavistaによって行われました。

プロジェクトについて

Shinobi CCTV deployment

インストール
ansible-galaxy install charliemaiors.shinobi
ライセンス
Unknown
ダウンロード
644