Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Updating your playbook set_stats fields to support integration with Automation Services Catalog


You can update your playbooks to pass information to Automation Services Catalog and support substitutable variables across the product in your order process workflow.

2.1. Writing playbook that return values to Automation Services Catalog

You can write playbooks designed to return values to Automation Services Catalog. Prefixing set_stats parameters with expose_to_cloud_redhat_com_ will return that value to Automation Services Catalog. You can then pass those values through additional playbooks using substitutable variables.

Use the playbook examples below to learn now about set_stats values and to pass values back to Automation Services Catalog and use them as substitutable values in subsequent playbooks in your order processes.

Example before order playbook

This before order playbook returns to Automation Services Catalog set_stats values for a favorite color:

# 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

Example product order playbook

This playbook passes a substitutable value back to Automation Services Catalog as an artifact value.

# 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

Example after order playbook

The after order playbook example below includes the artifact after_data value that was passed by the product playbook.

# 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
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat