実行環境の作成と使用
実行環境コンテナーの作成と使用
概要
はじめに リンクのコピーリンクがクリップボードにコピーされました!
実行環境ビルダーを使用して、Red Hat Ansible Automation Platform のニーズに合わせて一貫性があり再現可能なコンテナーを作成します。
Red Hat ドキュメントへのフィードバック (英語のみ) リンクのコピーリンクがクリップボードにコピーされました!
このドキュメントの改善に関するご意見がある場合や、エラーを発見した場合は、https://access.redhat.com から Technical Support チームに連絡してください。
第1章 自動化実行環境の概要 リンクのコピーリンクがクリップボードにコピーされました!
デフォルト以外の依存関係に依存する Ansible コンテンツの使用は、複雑になる場合があります。パッケージを各ノードにインストールし、ホストシステムにインストールされている他のソフトウェアとやり取りして、パッケージの同期を維持する必要があるためです。環境は、開発中もテスト中も、実稼働時も同じものを使用する必要があります。Red Hat はこの目的のために実行環境を提供しています。
自動化実行環境は、このプロセスを単純化し、Ansible Builder で簡単に作成できます。
第2章 Builder リンクのコピーリンクがクリップボードにコピーされました!
Ansible では、Execution Environment Utilities Collection の 1 つとして infra.ee_utilities を提供しています。Red Hat はこの目的のために実行環境を提供しています。これは、イメージを作成および管理したり、古い Tower の virtualenv から実行環境に移行したりするためのロールのコレクションです。このコレクションを使用すると、Ansible 実行環境の準備とメンテナンスを自動化できます。
2.1. 自動化実行環境について リンクのコピーリンクがクリップボードにコピーされました!
Red Hat Ansible Automation Platform のすべての自動化は、自動化実行環境と呼ばれるコンテナーイメージ上で実行されます。自動化実行環境は、自動化の依存関係を通信するための共通の言語を作成し、自動化環境を構築して配布するための標準的な方法を提供します。
Red Hat はサポート対象の実行環境を提供しています。これは Red Hat Ecosystem Catalog で使用できます。
自動化実行環境には、以下が含まれている必要があります。
- Ansible Core 2.16 以降
- Python 3.11 以降
- Ansible Runner
- Ansible コンテンツコレクションとその依存関係
- システムの依存関係
2.1.1. 自動化実行環境を使用する理由 リンクのコピーリンクがクリップボードにコピーされました!
自動化実行環境では、Red Hat Ansible Automation Platform はコントロールプレーンを実行プレーンから分離することで、分散アーキテクチャーに移行されました。コントロールプレーンから独立して自動化の実行を維持すると、開発サイクルが短縮され、環境間のスケーラビリティー、信頼性、および移植性が向上します。Red Hat Ansible Automation Platform には、Ansible コンテンツツールへのアクセスも含まれているため、自動化実行環境の構築と管理が容易になります。
自動化実行環境には、速度、移植性、柔軟性に加え、以下の利点があります。
- これにより、自動化が複数のプラットフォームで一貫して実行し、システムレベルの依存関係とコレクションベースのコンテンツを組み込むことができます。
- これにより、Red Hat Ansible Automation Platform の管理者は、さまざまなチームのニーズを満たす自動化環境を提供し、管理することができるようになります。
- 自動化実行環境を使用すると、自動化チームが自動化環境を自ら定義、構築、更新できるようになります。システム管理者は実行環境を提供できますが、各組織管理者も独自の実行環境を提供できます。
- これにより、自動化環境を構築して配布する標準的な方法を提供することで、自動化を簡単に拡張およびチーム間で共有できます。
第3章 Ansible Builder の使用 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder は、さまざまな Ansible Collections で定義されたメタデータを使用するか、ユーザーが作成したメタデータを使用して自動化実行環境を構築するプロセスを自動化するコマンドラインツールです。
Automation Controller を使用して実行環境を作成する前に、実行環境を構築する必要があります。構築したら、リポジトリー (quay など) に実行環境をプッシュする必要があります。その後、Automation Controller を使用して UI で実行環境を作成するときに、そのリポジトリーを指定して、Ansible Automation Platform でジョブテンプレートなどで使用できるようにする必要があります。
3.1. Ansible Builder を使用する理由 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder を使用すると、カスタマイズ可能な自動化実行環境の定義ファイルを簡単に作成し、そのファイルで自動化実行環境に含めるコンテンツ (Ansible Core、Python、Collections、サードパーティーの Python 要件、システムレベルのパッケージなど) を指定できます。これにより、ジョブを実行するために必要な要件と依存関係をすべて満たすことができます。
3.2. Ansible Builder のインストール リンクのコピーリンクがクリップボードにコピーされました!
前提条件
- ホストに有効なサブスクリプションが割り当てられている。これにより、ansible-builder のインストールに必要なサブスクリプション専用のリソースにアクセスできるようになり、ansible-builder に必要なリポジトリーが自動的に有効になります。詳細は、「Red Hat Ansible Automation Platform サブスクリプションの割り当て」を参照してください。
- Podman コンテナーランタイムがインストールされている。
ホストに有効なサブスクリプションが割り当てられている。これにより、
ansible-builderのインストールに必要なサブスクリプションのみのリソースにアクセスでき、ansible-builderに必要なリポジトリーが自動的に有効化されるようになります。詳細は、Red Hat Ansible Automation Platform サブスクリプションの割り当て を参照してください。注記Red Hat Ansible Automation Platform 管理対象ノードの有効なエンタイトルメントを使用せずに開発者ツールをインストールする場合は、無料の MCT4589 - Red Hat Ansible Developer, Standard (10 Managed Nodes) を使用できます。このサブスクリプションは、Ansible Automation Platform のユーザーを支援するためのものです。このサブスクリプションには、Ansible Business Unit による承認が必要です。
手順
次のコマンドを実行して、Ansible Builder をインストールし、Ansible Automation Platform リポジトリーをアクティブ化します。
# dnf install --enablerepo=ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms ansible-builder
3.3. 非接続環境での実行環境の構築 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Automation Platform の実行環境の構築は一般的なタスクですが、非接続環境では仕組みが異なります。カスタム実行環境を構築する際に、ansible-builder ツールはデフォルトで、インターネットの以下の場所からコンテンツをダウンロードします。
- Red Hat Automation Hub (console.redhat.com) または Ansible Galaxy (galaxy.ansible.com): 実行環境イメージに追加する Ansible コンテンツコレクション用
- PyPI (pypi.org): コレクションの依存関係として必要な Python パッケージ用
- RPM リポジトリー (RHEL リポジトリーや UBI リポジトリー (cdn.redhat.com) など): 必要に応じて、実行環境イメージに RPM を追加または更新するために使用
-
registry.redhat.io: ベースコンテナーイメージにアクセスするために使用
非接続環境で実行環境イメージをビルドするには、これらの場所からコンテンツをミラーリングする必要があります。Ansible Galaxy または Automation Hub から Private Automation Hub にコレクションをインポートする方法は、Automation Hub での自動化コンテンツコレクションのインポート を参照してください。
非接続ネットワークに転送されたミラーリングされた PyPI コンテンツは、Web サーバーまたは Nexus などのアーティファクトリポジトリーを使用して利用可能になります。RHEL および UBI リポジトリーのコンテンツは、インターネットに接続された Red Hat Satellite Server からエクスポートし、非接続環境にコピーして、非接続の Satellite にインポートできます。これにより、カスタム実行環境のビルドに使用できます。詳細は、エアギャップシナリオでの ISS エクスポート同期 を参照してください。
デフォルトのベースコンテナーイメージである ee-minimal-rhel8 は、カスタム実行環境イメージの作成に使用され、バンドルされたインストーラーに含まれています。このイメージは、インストール時に Private Automation Hub に追加されます。
ee-minimal-rhel9 などの別のベースコンテナーイメージが必要な場合は、それを非接続ネットワークにインポートし、Private Automation Hub コンテナーレジストリーに追加する必要があります。
非接続ネットワーク上ですべての前提条件が利用可能になったら、ansible-builder コマンドを使用してカスタム実行環境イメージを作成できます。
3.4. 定義ファイルの構築 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder を使用して実行環境を作成できます。新しい実行環境を構築するには、コレクション、Python 要件、システムレベルのパッケージなど、実行環境に含めるコンテンツを指定した定義が必要です。
Ansible Builder をインストールした後、Ansible Builder が自動化実行環境イメージを作成するために使用する定義ファイルを作成できます。Ansible Builder は、定義ファイルを読み取って検証してから Containerfile を作成し、最後にその Containerfile を Podman に渡して自動化実行環境イメージを作成します。続いて Podman は、自動化実行環境イメージをパッケージ化して作成します。作成する定義ファイルは、YAML 形式で、.yaml または .yml という拡張子を持ち、さまざまなセクションを含んでいる必要があります。指定されていない場合のデフォルトの定義ファイル名は、execution-environment.yml です。定義ファイルの各部分の詳細は、定義ファイルの内容の内訳 を参照してください。
以下はバージョン 3 の定義ファイルの例です。各定義ファイルでは、使用する Ansible Builder 機能セットのメジャーバージョン番号を指定する必要があります。指定しない場合、Ansible Builder はデフォルトでバージョン 1 になり、ほとんどの新機能と定義キーワードが使用できなくなります。
version: 3
build_arg_defaults:
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--pre'
dependencies:
galaxy: requirements.yml
python:
- six
- psutil
system: bindep.txt
images:
base_image:
name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest
# Custom package manager path for the RHEL based images
options:
package_manager_path: /usr/bin/microdnf
additional_build_steps:
prepend_base:
- RUN echo This is a prepend base command!
prepend_galaxy:
# Environment variables used for Galaxy client configurations
- ENV ANSIBLE_GALAXY_SERVER_LIST=automation_hub
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/xxxxxxx-synclist/
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
# define a custom build arg env passthru - we still also have to pass
# `--build-arg ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN` to get it to pick it up from the env
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN
prepend_final: |
RUN whoami
RUN cat /etc/os-release
append_final:
- RUN echo This is a post-install command!
- RUN ls -la /etc
関連情報
- 定義ファイルの内容の詳細は、定義ファイルの内容の内訳 を参照してください。
- Ansible Builder バージョン 2 と 3 の違いの詳細は、Ansible Builder Porting Guide を参照してください。
3.5. カスタム実行環境定義の作成 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder をインストールしたら、次の手順を使用してカスタム実行環境を作成します。
手順
カスタム実行環境のビルドアーティファクトを保存するディレクトリーを作成します。以下の手順で作成する新しいファイルは、このディレクトリーの下に作成されます。
$ mkdir $HOME/custom-ee $HOME/custom-ee/files $ cd $HOME/custom-ee/カスタム実行環境の要件を定義する
execution-environment.ymlファイルを作成します。注記実行環境定義形式のバージョン 3 が必要です。そのため、続行する前に、
execution-environment.ymlファイルにversion: 3が明示的に含まれていることを確認してください。- Private Automation Hub で利用可能な最小実行環境を指すように、ベースイメージをオーバーライドします。
-
ビルドプロセスで使用する非接続のコンテンツソースを指すために必要な、追加のビルドファイルを定義します。カスタムの
execution-environment.ymlファイルは次の例のようになります。
version: 3 images: base_image: name: private-hub.example.com/ee-minimal-rhel8:latest dependencies: python: requirements.txt galaxy: requirements.yml additional_build_files: - src: files/ansible.cfg dest: configs - src: files/pip.conf dest: configs - src: files/hub-ca.crt dest: configs # uncomment if custom RPM repositories are required #- src: files/custom.repo # dest: configs additional_build_steps: prepend_base: # copy a custom pip.conf to override the location of the PyPI content - ADD _build/configs/pip.conf /etc/pip.conf # remove the default UBI repository definition - RUN rm -f /etc/yum.repos.d/ubi.repo # copy the hub CA certificate and update the trust store - ADD _build/configs/hub-ca.crt /etc/pki/ca-trust/source/anchors - RUN update-ca-trust # if needed, uncomment to add a custom RPM repository configuration #- ADD _build/configs/custom.repo /etc/yum.repos.d/custom.repo prepend_galaxy: - ADD _build/configs/ansible.cfg ~/.ansible.cfg ...Private Automation Hub を指す
ansible.cfgファイルをfiles/サブディレクトリーに作成します。$ cat files/ansible.cfg [galaxy] server_list = private_hub [galaxy_server.private_hub] url = /https://private-hub.example.com/api/galaxy/内部 PyPI ミラー (Web サーバーまたは Nexus など) を指す
pip.confファイルをfiles/サブディレクトリーに作成します。$ cat files/pip.conf [global] index-url = https://<pypi_mirror_fqdn>/ trusted-host = <pypi_mirror_fqdn>オプション: カスタム実行環境に RPM を追加するために
bindep.txtファイルを使用する場合は、非接続の Satellite、または RPM リポジトリーをホストする他の場所を指すfiles/サブディレクトリーに、custom.repoファイルを作成します。この手順が必要な場合は、custom.repoファイルに対応するサンプルのexecution-environment.ymlファイル内の手順をコメント解除します。次の例は UBI リポジトリーの場合です。他のローカルリポジトリーもこのファイルに追加できます。ミラーコンテンツが Web サーバーのどこにあるかに応じて、URL パスの変更が必要な場合があります。
$ cat files/custom.repo [ubi-8-baseos] name = Red Hat Universal Base Image 8 (RPMs) - BaseOS baseurl = http://<ubi_mirror_fqdn>/repos/ubi-8-baseos enabled = 1 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release gpgcheck = 1 [ubi-8-appstream] name = Red Hat Universal Base Image 8 (RPMs) - AppStream baseurl = http://<ubi_mirror_fqdn>/repos/ubi-8-appstream enabled = 1 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release gpgcheck = 1Private Automation Hub Web サーバー証明書の署名に使用される CA 証明書を追加します。Private Automation Hub が、インストーラーによって提供される自己署名証明書を使用する場合は、以下の手順を行います。
-
Private Automation Hub からファイル
/etc/pulp/certs/pulp_webserver.crtをコピーし、hub-ca.crtという名前を付けます。 -
hub-ca.crtファイルをfiles/サブディレクトリーに追加します。
-
Private Automation Hub からファイル
Private Automation Hub が、認証局によって署名されたユーザー提供の証明書を使用する場合は、以下の手順を行います。
-
その CA 証明書のコピーを作成し、
hub-ca.crtという名前を付けます。 -
hub-ca.crtファイルをfiles/`サブディレクトリーに追加します。
-
その CA 証明書のコピーを作成し、
上記の手順を完了したら、カスタム実行環境イメージに必要なコンテンツを含む Python の
requirements.txtファイルと Ansible コレクションのrequirements.ymlファイルを作成します。注記必要なコレクションはすべて、Private Automation Hub に事前にアップロードする必要があります。
次のファイルは、
custom-ee/ディレクトリーに存在する必要があります。bindep.txtとfiles/custom.repoは任意です。
$ cd $HOME/custom-ee
$ tree .
.
├── bindep.txt
├── execution-environment.yml
├── files
│ ├── ansible.cfg
│ ├── custom.repo
│ ├── hub-ca.crt
│ └── pip.conf
├── requirements.txt
└── requirements.yml
1 directory, 8 files
3.6. 自動化実行環境イメージのビルド リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルを作成したら、自動化実行環境イメージのビルドに進むことができます。
実行環境イメージをビルドするときは、Ansible Automation Platform がデプロイされるアーキテクチャーをサポートする必要があります。
前提条件
- 定義ファイルを作成している。
手順
自動化実行環境イメージをビルドするには、コマンドラインから次のコマンドを実行します。
$ ansible-builder build
Ansible Builder は、デフォルトでは execution-environment.yml という名前の定義ファイルを探しますが、-f フラグを使用して異なるファイルパスを引数として指定できます。
以下に例を示します。
$ ansible-builder build -f definition-file-name.yml
definition-file-name は、定義ファイルの名前を指定します。
3.7. 定義ファイルの内容の内訳 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder を使用して自動化実行環境を構築するには、自動化実行環境のコンテナーイメージに含めるコンテンツを指定した定義ファイルを用意する必要があります。
次のセクションでは、定義ファイルの内容を説明します。
3.7.1. ビルド引数 リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルの build_arg_defaults セクションはディクショナリーです。このディクショナリーのキーで、Ansible Builder に渡す引数のデフォルト値を指定できます。
次の表は、build_arg_defaults で使用できる値を示しています。
| 値 | 説明 |
|---|---|
|
| この値を使用すると、コレクションのインストールフェーズ中に、ansible-galaxy CLI に任意の引数を渡すことができます。
たとえば、リリース前のコレクションのインストールを有効にするには |
|
|
この値を使用すると、 |
通常は、podman を使用してベースイメージをカスタマイズし、カスタムベースイメージを作成してから、このカスタムイメージで ansible-builder を呼び出すほうが (特にパイプラインとの関連で) 簡単です。
build_arg_defaults で指定される値は Containerfile にハードコーディングされるため、podman build を手動で呼び出すとこの値が維持されます。
CLI の --build-arg フラグで同じ変数が指定されている場合は、CLI の値が優先されます。
3.7.2. 定義の依存関係 リンクのコピーリンクがクリップボードにコピーされました!
最終イメージにインストールする必要がある依存関係は、定義ファイルの依存関係セクションに含めることができます。
自動化実行環境イメージに関する問題を回避するには、Galaxy、Python、およびシステムのエントリーが有効な要件ファイルを指していること、またはそれぞれのファイルタイプに対して有効なコンテンツであることを確認してください。
3.7.2.1. Galaxy リンクのコピーリンクがクリップボードにコピーされました!
galaxy エントリーには、有効な要件ファイルへの参照か、ansible-galaxy collection install -r … コマンドのインラインコンテンツを含めます。
requirements.yml エントリーは、自動化実行環境定義のフォルダーのディレクトリーからの相対パスか、絶対パスにすることができます。
内容は次のようになります。
collections:
- community.aws
- kubernetes.core
3.7.2.2. Python リンクのコピーリンクがクリップボードにコピーされました!
定義ファイル内の Python エントリーでは、有効な要件ファイル、または PEP508 形式で pip install -r … コマンドの Python 要件のインラインリストを指定します。
requirements.txt エントリーは、コレクションですでに Python 依存関係としてリストされているものに加えて、追加の Python 要件をインストールするファイルです。このエントリーは、自動化実行環境定義のフォルダーのディレクトリーを基準とした相対パス、または絶対パスの形で指定できます。requirements.txt ファイルの内容は、pip freeze コマンドの標準出力と同様に、次の例のような形式にする必要があります。
内容は次のようになります。
boto>=2.49.0
botocore>=1.12.249
pytz
python-dateutil>=2.7.0
awxkit
packaging
requests>=2.4.2
xmltodict
azure-cli-core==2.11.1
openshift>=0.6.2
requests-oauthlib
openstacksdk>=0.13
ovirt-engine-sdk-python>=4.4.10
3.7.2.3. システム リンクのコピーリンクがクリップボードにコピーされました!
定義内の system エントリーは、bindep 要件ファイルまたは bindep エントリーのインラインリストを指します。これらは、コレクションに依存関係としてすでに含まれているものの範囲外にあるシステムレベルの依存関係をインストールします。system エントリーは、自動化実行環境定義のフォルダーのディレクトリーを基準とした相対パス、または絶対パスの形で指定できます。少なくとも、コレクションで [platform:rpm] に必要な要件を指定する必要があります。
これを説明するために、libxml2 および subversion パッケージをコンテナーに追加する bindep.txt ファイルの例を次に示します。
内容は次のようになります。
libxml2-devel [platform:rpm]
subversion [platform:rpm]
複数のコレクションからのエントリーは、1 つのファイルに統合されます。これは bindep により処理され、dnf に渡されます。プロファイルのない要件や、ランタイム要件がイメージにインストールされません。
3.7.2.4. イメージ リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルの images セクションでは、ベースイメージを指定します。署名付きコンテナーイメージの検証は、podman コンテナーランタイムでサポートされています。
次の表は、images で使用できる値のリストを示しています。
| 値 | 説明 |
|---|---|
|
| 自動化実行環境の親イメージを指定し、既存のイメージに基づいて新しいイメージをビルドできるようにします。これは通常、ee-minimal または ee-supported などのサポートされる実行環境ベースイメージですが、作成済みでさらにカスタマイズしたい実行環境イメージでも問題ありません。
コンテナーイメージが使用するには
デフォルトのイメージは |
3.8. 追加のビルドファイル リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルの additional_build_files セクションに外部ファイルを参照またはコピーすることで、任意の外部ファイルをビルドコンテキストディレクトリーに追加できます。形式はディクショナリー値のリストで、各リスト項目に src および dest のキーと値を含めます。
各リスト項目は、次の必須キーを含むディクショナリーである必要があります。
src-
ビルドコンテキストディレクトリーにコピーするソースファイルを指定します。これは、絶対パス (
/home/user/.ansible.cfgなど) か、実行環境ファイルへの相対パスにすることができます。相対パスは、1 つ以上のファイルに一致する glob 式にすることができます (files/*.cfgなど)。
絶対パスには正規表現を含めることはできません。src がディレクトリーの場合、そのディレクトリーの内容全体が dest にコピーされます。
dest-
ソースファイル (例:
files/configs) が含まれるビルドコンテキストディレクトリーの_buildサブディレクトリーの下にあるサブディレクトリーパスを指定します。この値を絶対パスにしたり、パス内に..を含めたりすることはできません。このディレクトリーが存在しない場合は、Ansible Builder によって作成されます。
3.9. 追加のカスタムビルドの手順 リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルの additional_build_steps セクションで、任意のビルドフェーズのカスタムビルドコマンドを指定できます。これにより、ビルドフェーズをきめ細かく制御できるようになります。
prepend_ および append_ コマンドを使用して、メインのビルドステップの実行前または実行後に実行されるディレクティブを Containerfile に追加します。コマンドは、ランタイムシステムに必要なルールに準拠する必要があります。
additional_build_steps で使用できる値のリストは、次の表を参照してください。
| 値 | 説明 |
|---|---|
|
| ベースイメージをビルドする前にコマンドを挿入できます。 |
|
| ベースイメージをビルドした後にコマンドを挿入できます。 |
|
| galaxy イメージをビルドする前に挿入できます。 |
|
| galaxy イメージをビルドした後に挿入できます。 |
|
| Python ビルダーイメージをビルドする前に、コマンドを挿入できます。 |
|
| Python ビルダーイメージをビルドした後に、コマンドを挿入できます。 |
|
| 最終イメージをビルドする前に挿入できます。 |
|
| 最終イメージをビルドした後に挿入できます。 |
additional_build_steps の構文は、複数行の文字列とリストの両方をサポートしています。以下の例を参照してください。
例3.1 複数行の文字列エントリー
prepend_final: |
RUN whoami
RUN cat /etc/os-release
例3.2 リストエントリー
append_final:
- RUN echo This is a post-install command!
- RUN ls -la /etc
例3.3 任意のファイルを実行環境にコピーする
additional_build_files:
# copy arbitrary files next to this EE def into the build context - we can refer to them later...
- src: files/rootCA.crt
dest: configs
additional_build_steps:
prepend_base:
# copy a custom CA cert into the base image and recompute the trust database
# because this is in "base", all stages will inherit (including the final EE)
- COPY _build/configs/rootCA.crt /usr/share/pki/ca-trust-source/anchors
- RUN update-ca-trust
additional_build_files セクションを使用すると、rootCA.crt をビルドコンテキストディレクトリーに追加できます。このファイルをビルドコンテキストディレクトリーにコピーすると、ファイルをビルドプロセスで使用できるようになります。ファイルを使用するには、additional_build_steps セクションの prepend_base ステップで指定した COPY ディレクティブを使用して、ビルドコンテキストディレクトリーからファイルをコピーします。コピーしたファイルに基づいて任意のアクションを実行できます。たとえば、この例では、RUN update-ca-trust を実行して CA 証明書の動的設定を更新します。
3.9.1. 環境変数を使用した実行環境の構築 リンクのコピーリンクがクリップボードにコピーされました!
次のサンプルファイルでは、ビルドプロセスに必要な可能性のある環境変数を指定しています。
この機能を実現するために、additional_build_steps セクションの prepend_base ステップで ENV 変数定義を使用します。
—
additional_build_steps:
prepend_base:
- ENV FOO=bar
- RUN echo $FOO > /tmp/file1.txt
ビルドプロセスの後の段階でも同じ環境変数を使用できます。
3.9.2. Galaxy 設定の環境変数を使用した実行環境の構築 リンクのコピーリンクがクリップボードにコピーされました!
Ansible Builder スキーマ 3 を使用すると、カスタムの Galaxy 設定を指定するなど、複雑な手順を実行できます。この方法を使用すると、認証トークンなどの機密情報を、最終的な実行環境イメージに漏洩することなく、実行環境ビルドに渡すことができます。
次の例では、Ansible Galaxy Server 環境変数を使用します。
additional_build_steps:
prepend_galaxy:
# Environment variables used for Galaxy client configurations
- ENV ANSIBLE_GALAXY_SERVER_LIST=automation_hub
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/xxxxxxx-synclist/
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
# define a custom build arg env passthru - we still also have to pass
# `--build-arg ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN` to get it to pick it up from the env
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN
options:
package_manager_path: /usr/bin/microdnf # downstream images use non-standard package manager
ENV ディレクティブを使用して、ANSIBLE_GALAXY_SERVER_LIST、ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL、ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL などの環境変数を提供できます。詳細は、Ansible ドキュメントの Galaxy User Guide を参照してください。
セキュリティー上の理由から、ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN に機密情報を保存しないでください。ARG ディレクティブを使用すると、ユーザーからの機密情報を入力として受け取ることができます。
ansible-builder コマンドを呼び出すときに -build-args を使用すると、この情報を提供できます。
3.10. 実行環境イメージの場所の更新 リンクのコピーリンクがクリップボードにコピーされました!
Private Automation Hub を Ansible Automation Platform とは別にインストールした場合は、Private Automation Hub を参照するように実行環境イメージの場所を更新できます。
手順
-
setup.shが保存されているディレクトリーに移動します。 次のコマンドを実行して、
./group_vars/automationcontrollerを作成します。touch ./group_vars/automationcontroller次の内容を
./group_vars/automationcontrollerに貼り付けます。環境に合わせて設定を調整します。# Automation Hub Registry registry_username: 'your-automation-hub-user' registry_password: 'your-automation-hub-password' registry_url: 'automationhub.example.org' registry_verify_ssl: False ## Execution Environments control_plane_execution_environment: 'automationhub.example.org/ee-supported-rhel8:latest' global_job_execution_environments: - name: "Default execution environment" image: "automationhub.example.org/ee-supported-rhel8:latest" - name: "Minimal execution environment" image: "automationhub.example.org/ee-minimal-rhel8:latest"注記registry_usernameとregistry_passwordの取得方法については、registry_username と registry_password の設定 を参照してください。./setup.shスクリプトを実行します。$ ./setup.sh
検証
- システム管理者アクセス権を持つユーザーとして Ansible Automation Platform にログインします。
- → → に移動します。
-
Image 列で、実行環境イメージの場所がデフォルト値の
<registry url>/ansible-automation-platform-<version>/<image name>:<tag>から<automation hub url>/<image name>:<tag>に変更されていることを確認します。
3.11. 任意のビルドコマンド引数 リンクのコピーリンクがクリップボードにコピーされました!
-t フラグは、自動化実行環境イメージに特定の名前でタグ付けします。たとえば、次のコマンドでは、my_first_ee_image という名前のイメージをビルドします。
$ ansible-builder build -t my_first_ee_image
build で -t を使用しない場合は、ansible-execution-env というイメージが作成され、ローカルのコンテナーレジストリーに読み込まれます。
複数の定義ファイルがある場合は、-f フラグを含めることで、どれを使用するかを指定できます。
$ ansible-builder build -f another-definition-file.yml -t another_ee_image
この例では、Ansible Builder は、デフォルトの execution-environment.yml ではなく、another-definition-file.yml という名前のファイルで提供される仕様を使用して、another_ee_image という名前の自動化実行環境イメージをビルドします。
build コマンドで使用できるその他の仕様とフラグは、ansible-builder build --help と入力して、追加オプションのリストを表示します。
3.12. Containerfile リンクのコピーリンクがクリップボードにコピーされました!
定義ファイルを作成すると、Ansible Builder がそれを読み取って検証し、Containerfile とコンテナービルドコンテキストを作成して、必要に応じてこれらを Podman に渡して自動化実行環境イメージをビルドします。コンテナーのビルドは、base、galaxy、builder、および final といういくつかの異なるステージで行われます。イメージのビルド手順 (および、additional_build_steps で定義された対応するカスタムの prepend_ および append_ 手順) は次のとおりです。
-
baseビルドステージでは、指定されたベースイメージが、Python、pip、ansible-core、ansible-runnerなど、他のビルドステージで必要なコンポーネントを使用して (オプションで) カスタマイズされます。次に、生成されたイメージが検証され、必要なコンポーネントが利用可能であることが確認されます (コンポーネントはベースイメージにすでに存在している可能性があるため)。結果として得られるカスタマイズされたbaseイメージの一時的なコピーは、他のすべてのビルドステージのベースとして使用されます。 -
galaxyビルドステージでは、定義ファイルで指定されたコレクションがダウンロードされ、finalビルドステージでのインストールのために保存されます。コレクションによって宣言された Python とシステムの依存関係も (存在する場合)、今後の分析のために収集されます。 -
builderビルドステージでは、コレクションによって宣言された Python の依存関係が、定義ファイルにリストされている依存関係とマージされます。この最後の Python 依存関係セットは、Python ホイールとしてダウンロードおよびビルドされ、finalビルドステージでのインストールのために保存されます。 -
finalビルドステージでは、以前にダウンロードしたコレクションが、システムパッケージおよびコレクションによって依存関係として宣言された、または定義ファイルにリストされていた、以前にビルドされた Python パッケージとともにインストールされます。
3.13. イメージをビルドせずに Containerfile を作成する リンクのコピーリンクがクリップボードにコピーされました!
セキュリティー上の理由から、サンドボックス環境でビルドした共有コンテナーイメージを使用する必要がある場合は、共有可能な Containerfile を作成できます。
$ ansible-builder create
3.14. イメージをビルドするための YAML ファイルの例 リンクのコピーリンクがクリップボードにコピーされました!
'ansible-builder' ビルドコマンドは、実行環境の定義を入力として受け取ります。実行環境イメージのビルドに必要なビルドコンテキストを出力し、そのイメージをビルドします。このイメージは、ビルドコンテキストを使用して他の場所で再ビルドでき、同じ結果が得られます。デフォルトでは、ビルダーは現在のディレクトリーで execution-environment.yml という名前のファイルを検索します。
次の execution-environment.yml ファイルの例は、開始点として使用できます。
version: 3
dependencies:
galaxy: requirements.yml
The content of requirements.yml:
---
collections:
- name: awx.awx
To build an execution environment using the preceding files and run the following command:
ansible-builder build
...
STEP 7: COMMIT my-awx-ee
--> 09c930f5f6a
09c930f5f6ac329b7ddb321b144a029dbbfcc83bdfc77103968b7f6cdfc7bea2
Complete! The build context can be found at: context
すぐに使用できるコンテナーイメージが生成されるだけでなく、ビルドコンテキストが保持されます。このイメージは、docker build や podman build などの任意のツールを使用して、別の時間または場所で再ビルドできます。
第4章 一般的な自動化実行環境のシナリオ リンクのコピーリンクがクリップボードにコピーされました!
一般的な設定シナリオに対応するには、次の定義ファイルの例を使用します。
4.1. Automation Hub CA 証明書の更新 リンクのコピーリンクがクリップボードにコピーされました!
この例を使用して、デフォルトの定義ファイルをカスタマイズして CA 証明書を additional-build-files セクションに含め、そのファイルを適切なディレクトリーに移動します。最後にコマンドを実行して CA 証明書の動的設定を更新し、システムがこの CA 証明書を信頼できるようにします。
前提条件
-
カスタム CA 証明書 (例:
rootCA.crt)。
prepend_base を使用して CA 証明書をカスタマイズすると、その結果作成される CA 設定が、他のすべてのビルドステージと最終イメージに表示されます。他のすべてのビルドステージは、ベースイメージから継承されるためです。
additional_build_files:
# copy the CA public key into the build context, we will copy and use it in the base image later
- src: files/rootCA.crt
dest: configs
additional_build_steps:
prepend_base:
# copy a custom CA cert into the base image and recompute the trust database
# because this is in "base", all stages will inherit (including the final EE)
- COPY _build/configs/rootCA.crt /usr/share/pki/ca-trust-source/anchors
- RUN update-ca-trust
options:
package_manager_path: /usr/bin/microdnf # downstream images use non-standard package manager
[galaxy]
server_list = automation_hub
4.2. 自動化実行環境を構築する際に Automation Hub 認証の詳細を使用する リンクのコピーリンクがクリップボードにコピーされました!
以下の例を使用して、デフォルトの定義ファイルをカスタマイズし、Automation Hub 認証の詳細を、最終的な自動化実行環境イメージで公開することなく、自動化実行環境ビルドに渡します。
前提条件
-
Red Hat Certified Collection の API トークンの取得 の説明のとおりに API トークンを作成し、
token.txtという名前のファイルなどのセキュアな場所に保存した。 - Automation Hub API トークンが入力されるビルド引数を定義した。
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=$(cat <token.txt>)
additional_build_steps:
prepend_galaxy:
# define a custom build arg env passthru- we still also have to pass
# `--build-arg ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN` to get it to pick it up from the host env
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN
- ENV ANSIBLE_GALAXY_SERVER_LIST=automation_hub
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/<yourhuburl>-synclist/
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
関連情報
- 自動化実行環境の定義ファイルの各部分については、定義ファイルの内容の内訳 を参照してください。
第5章 自動化実行環境の公開 リンクのコピーリンクがクリップボードにコピーされました!
5.1. 既存の自動化実行環境イメージのカスタマイズ リンクのコピーリンクがクリップボードにコピーされました!
Ansible Controller には、次のデフォルトの実行環境が含まれています。
Minimal-ansible-automation-platform-25には、最新の Ansible-core 2.16 リリースと Ansible Runner が含まれていますが、コレクションやその他のコンテンツは含まれていません。ansible-automation-platform-24 には、Ansible Runner とともに Ansible-core 2.15 リリースが含まれていますが、コレクションやその他のコンテンツは含まれていません。サポート対象の実行環境は、多くの自動化の前提条件を満たすものです。しかし、依存関係とそのバージョンを完全に制御するには、Minimal 実行環境を独自のカスタムイメージのベースとして使用することを推奨します。
-
EE Supported- Minimal に加え、Red Hat がサポートするすべてのコレクションと依存関係が含まれています。
これらの環境は多くの自動化ユースケースに対応しますが、追加の項目を追加して、特定のニーズに合わせてこれらのコンテナーをカスタマイズできます。以下の手順では、kubernetes.core コレクションを ee-minimal デフォルトイメージに追加します。
手順
Podman を使用して
registry.redhat.ioにログインします。$ podman login -u="[username]" -p="[token/hash]" registry.redhat.io必要な自動化実行環境のベースイメージをプルできることを確認します。
podman pull registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel8:latest必要なベースイメージと新しい実行環境イメージに追加する追加のコンテンツを指定するように Ansible Builder ファイルを設定します。
たとえば、Galaxy の Kubernetes Core Collection をイメージに追加するには、Galaxy エントリーを使用します。
collections: - kubernetes.core- 定義ファイルとその内容の詳細は、定義ファイルの内容の内訳 セクションを参照してください。
実行環境の定義ファイルの
EE_BASE_IMAGEフィールドに、元のee-minimalコンテナーの URL とタグを指定します。編集後の最終的なexecution-environment.ymlファイルは次のようになります。例5.1 カスタマイズされた
execution-environment.ymlファイルversion: 3 images: base_image: 'registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest' dependencies: galaxy: collections: - kubernetes.core注記この例では、自動化ハブの認定コレクションではなく、コミュニティーバージョンの
kubernetes.coreを使用するため、ansible.cfgファイルを作成したり、定義ファイルで参照したりする必要はありません。以下のコマンドを使用して、新しい実行環境イメージをビルドします。
$ ansible-builder build -t [username]/new-eeここで、
[username]はユーザー名を指定し、new-eeは新しいコンテナーイメージの名前を指定します。注記buildで-tを使用しない場合は、ansible-execution-envというイメージが作成され、ローカルのコンテナーレジストリーに読み込まれます。podman imagesコマンドを使用して、新しいコンテナーイメージが一覧に表示されていることを確認します。以下は、イメージ
new-eeを使用した 'podman images' コマンドの出力を示しています。REPOSITORY TAG IMAGE ID CREATED SIZE localhost/new-ee latest f5509587efbb 3 minutes ago 769 MB
コレクションがインストールされていることを確認します。
$ podman run [username]/new-ee ansible-doc -l kubernetes.coreAutomation Hub で使用するイメージにタグを付けます。
$ podman tag [username]/new-ee [automation-hub-IP-address]/[username]/new-eePodman を使用して Automation Hub にログインします。
注記コンテナーをプッシュするには、Automation Hub の
adminまたは適切なコンテナーリポジトリーのアクセス許可が必要です。詳細は、Private Automation Hub でのコンテナーの管理 を参照してください。$ podman login -u="[username]" -p="[token/hash]" [automation-hub-IP-address]イメージを自動化ハブのコンテナーレジストリーにプッシュします。
$ podman push [automation-hub-IP-address]/[username]/new-ee新しいイメージを自動化コントローラーインスタンスにプルします。
- Automation Controller に移動します。
- ナビゲーションパネルから、 → → を選択します。
- をクリックします。
適切な情報を入力して をクリックし、新規イメージにプルします。
注記自動化ハブのインスタンスがパスワードまたはトークンで保護されている場合は、適切なコンテナーレジストリーの認証情報が設定されていることを確認してください。
第6章 Private Automation Hub コンテナーレジストリーへの入力 リンクのコピーリンクがクリップボードにコピーされました!
デフォルトでは、Private Automation Hub には自動化実行環境が含まれていません。コンテナーレジストリーに入力するには、コンテナーレジストリーに実行環境をプッシュする必要があります。
6.1. プライベートハブへのカスタム実行環境のアップロード リンクのコピーリンクがクリップボードにコピーされました!
新しい実行環境イメージを自動化ジョブに使用するには、使用前にイメージを Private Automation Hub にアップロードする必要があります。
まず、実行環境イメージがローカルの podman キャッシュに表示されることを確認します。
$ podman images --format "table {{.ID}} {{.Repository}} {{.Tag}}"
IMAGE ID REPOSITORY TAG
b38e3299a65e private-hub.example.com/custom-ee latest
8e38be53b486 private-hub.example.com/ee-minimal-rhel8 latest
Private Automation Hub のコンテナーレジストリーにログインし、イメージをプッシュして、ジョブテンプレートとワークフローで使用できるようにします。
$ podman login private-hub.example.com -u admin
Password:
Login Succeeded!
$ podman push private-hub.example.com/custom-ee:latest
次のワークフローを使用して、Private Automation Hub のリモートレジストリーに入力します。
関連情報
レジストリーの詳細は、Red Hat Container Registry Authentication を参照してください。
付録A 自動化実行環境の優先順位 リンクのコピーリンクがクリップボードにコピーされました!
プロジェクトの更新では、常にデフォルトでコントロールプレーンの自動化実行環境が使用されます。一方、ジョブでは、次の順序で最初に利用可能な自動化実行環境が使用されます。
-
ジョブを作成したテンプレート (ジョブテンプレートまたはインベントリーソース) で定義される
execution_environment。 -
ジョブが使用するプロジェクトで定義される
default_environment。 -
ジョブの組織で定義される
default_environment。 -
ジョブが使用するインベントリーの組織で定義される
default_environment。 -
現在の
DEFAULT_EXECUTION_ENVIRONMENT設定 (api/v2/settings/system/で設定可能)。 -
GLOBAL_JOB_EXECUTION_ENVIRONMENTS設定からのイメージ。 - その他のグローバル実行環境。
複数の実行環境が基準 (6 および 7 に適用) に適合する場合は、最近作成された実行環境が使用されます。
オープンソースライセンス リンクのコピーリンクがクリップボードにコピーされました!
Apache license
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity.For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner.For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License.Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License.Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted.If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
- You must cause any modified files to carry prominent notices stating that You changed the files; and
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear.The contents of the NOTICE file are for informational purposes only and do not modify the License.You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions.Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks.This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability.In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License.However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS