LoginSignup
1
0

More than 1 year has passed since last update.

Ansibleを用いたOpsRamp - OneView連携

Last updated at Posted at 2022-04-20

やりたいこと

新規デバイス検出時にOneViewでサーバプロファイルをそのデバイスに割り当てる。

OneView_Integration_for_Qiita.gif

構成

Diagram.png

  1. OpsRamp Gatewayによるデバイス検出
  2. デバイス検出イベントをトリガにProcess Definitions(workflow)を実行
    1. OpsRamp AgentからAnsible Playbookを実行
    2. Ansible Playbookにより、OnveViewで以下を実行
      a) Server Profile TemplateからServer Profileを作成
      b) Server Profileに検出したデバイスを割り当てる

AnsibleでOneViewを操作するために「oneview-ansible-collection」を使用
https://github.com/HewlettPackard/oneview-ansible-collection

OpsRamp設定

デバイス検出設定

「Setup」->「Resources」->「検出(ディスカバリ)と配置」から検出プロファイルを作成
DiscoveryProfile1.png

各項目を適宜設定
DiscoveryProfile2.PNG

「検出プロファイルのタイプ」に「SNMP」を選択
「認証情報」に予め作成したSNMPの認証方法を選択 (「資格情報の作成」から新規作成することも可能)

Ansible Integration

「Setup」->「インテグレーション」->「インテグレーション」からAnsibleインテグレーションをインストール
AnsibleIntegration1.PNG

Ansibleデバイスを選択
AnsibleIntegration2.PNG

予めAnsibleデバイスにOpsRamp Agentのインストールが必要

Ansible Playbookを登録
AnsibleIntegration3.PNG

Process Definition (Workflow)

「Automatin」->「Process Definitions」からWorkflowを作成
ProcessDefinitions1_.PNG

「StartEvent」、「Script Task」、「EndEvent」を配置し、「Script Task」を下記のように設定

  • Configuration: 「Agentless」を選択
  • Integration: インストールしたAnsible Integrationを選択
  • Playbook: 登録したAnsible Playbookを選択
  • Inputs: デバイス情報をAnsible Playbookの引数として渡すパラメータを入力 (「Process Definition」では、変数としてデバイス情報を持つ)
    ProcessDefinitions2.png
1
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
1
0