第2章 Automation Services Catalog との統合をサポートするための Playbook set_stats フィールドの更新


Playbook を更新して、Automation Services Catalog に情報を渡して、オーダープロセスワークフローの製品全体にわたる置換可能な変数をサポートすることができます。

2.1. 値を Automation Services Catalog に戻す Playbook の作成

値を Automation Services Catalog に戻すように設計された Playbook を作成できます。set_stats パラメーターの前に expose_to_cloud_redhat_com_ を加えると、その値が Automation Services Catalog に戻されます。次に、置換可能な変数を使用して、追加の Playbook でこれらの値を渡すことができます。

以下の Playbook の例を使用して set_stats の値について確認し、値を Automation Services Catalog に戻し、これをオーダープロセスの後続の Playbook の置換可能な値として使用します。

before order Playbook の例

この before order Playbook は、お気に入りの色を Automation Services Catalog set_stats 値に戻します。

# This playbook prints a simple debug message and set_stats
- name: Echo Hello, world!
  hosts: localhost
  gather_facts: yes
  tasks:
    - debug:
        msg: "Hello, world!"

    - set_stats:
        data:
          expose_to_cloud_redhat_com_favorite_color: "orange"
Copy to Clipboard Toggle word wrap

product order Playbook の例

この Playbook は、アーティファクトの値として Automation Services Catalog に置換可能な値を渡します。

# This playbook prints a simple debug message with given information
- name: Echo Hello, world!
  hosts: localhost
  gather_facts: yes
  tasks:
    - debug:
        msg: "Hello, {{favorite_color}} world!"

    - set_stats:
        data:
          expose_to_cloud_redhat_com_after_data: "{{favorite_color}}"
Copy to Clipboard Toggle word wrap

after order Playbook の例

以下の after order Playbook の例には、製品 Playbook によって渡されたアーティファクトの after_data 値が含まれます。

# This playbook prints a simple debug message with given information
- name: Echo Hello, world!
  hosts: localhost
  gather_facts: yes
  tasks:
    - debug:
        msg: "{{after_data}}"
~
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat