付録C Ansible インベントリー場所の設定

オプションとして、ceph-ansible ステージング環境および実稼働環境用のインベントリーの場所ファイルを設定することができます。

前提条件

  • Ansible 管理ノード。
  • Ansible 管理ノードへの root レベルのアクセス。
  • ceph-ansible パッケージがノードにインストールされている。

手順

  1. /usr/share/ceph-ansible ディレクトリーに移動します。

    [ansible@admin ~]# cd /usr/share/ceph-ansible
  2. ステージングおよび実稼働環境用のサブディレクトリーを作成します。

    [ansible@admin ceph-ansible]$ mkdir -p inventory/staging inventory/production
  3. ansible.cfg ファイルを編集し、以下の行を追加します。

    [defaults]
    inventory = ./inventory/staging # Assign a default inventory directory
  4. 各環境用にインベントリーの hosts ファイルを作成します。

    [ansible@admin ceph-ansible]$ touch inventory/staging/hosts
    [ansible@admin ceph-ansible]$ touch inventory/production/hosts
    1. hosts ファイルを開いて編集し、[mons] セクションの下に Ceph Monitor ノードを追加します。

      [mons]
      MONITOR_NODE_NAME_1
      MONITOR_NODE_NAME_1
      MONITOR_NODE_NAME_1

      [mons]
      mon-stage-node1
      mon-stage-node2
      mon-stage-node3

      注記

      デフォルトでは、Playbook はステージング環境で実行されます。実稼働環境で Playbook を実行するには、以下を実行します。

      [ansible@admin ceph-ansible]$ ansible-playbook -i inventory/production playbook.yml

関連情報