IT 서비스 관리(ITSM) 시스템과 Automation Services Catalog 통합

Red Hat Ansible Automation Platform 2.1

주문 프로세스 및 대체 변수에서 정의한 워크플로를 사용하여 Automation Services Catalog를 IT 서비스 관리 시스템에 통합합니다.

Red Hat Customer Content Services

초록

이 가이드에서는 순서 프로세스 및 대체 변수를 사용하여 Ansible Automation Platform의 작업 템플릿에서 IT 서비스 관리(ITM) 시스템으로 데이터를 전달하는 방법에 대한 워크플로를 설명합니다.

머리말

Automation Services Catalog의 주문 프로세스 기능을 사용하여 ServiceNow와 같은 정보 기술 서비스 관리(ITSM) 시스템과 통합할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 용어를 교체하기 위해 최선을 다하고 있습니다. 먼저 마스터(master), 슬레이브(slave), 블랙리스트(blacklist), 화이트리스트(whitelist) 등 네 가지 용어를 교체하고 있습니다. 이러한 변경 작업은 작업 범위가 크므로 향후 여러 릴리스에 걸쳐 점차 구현할 예정입니다. 자세한 내용은 CTO Chris Wright의 메시지를 참조하십시오.

1장. ITSM과 Automation Services Catalog의 통합 계획

Ansible Automation Platform 및 플레이북 인벤토리에 필요한 업데이트 및 수정 사항을 ITSM 시스템과 통합할 계획입니다. 일부 변경 사항은 Ansible Tower 및 Automation Services Catalog에서 특정 수준의 관리 권한이 필요합니다.

이 섹션에서는 업데이트를 수행하는 데 필요한 정확한 역할과 수정해야 하는 아티팩트에 대해 자세히 설명합니다.

필수 권한

통합 워크플로를 완료하려면 다음 역할이 필요합니다.

  • ITSM 통합에 사용되는 플레이북을 작성하거나 업데이트할 수 있습니다.
  • Ansible Tower 관리자이며 작업 템플릿을 생성하고 설문조사를 추가할 수 있습니다.
  • 카탈로그 관리자이며 포트폴리오를 생성하고 설문조사를 편집하며 주문 프로세스를 설정할 수 있습니다.

플레이북

ITSM에서 Automation Services Catalog와 통합하려는 작업 템플릿 및 워크플로우에 사용된 플레이북을 작성하거나 업데이트합니다.

Ansible Tower 작업 및 워크플로우 템플릿 설문 조사

이전 및 이후에 실행되는 작업 템플릿에 첨부된 설문조사를 업데이트하여 대체 가능한 값을 지원합니다.

Automation Services Catalog

ITSM 통합 워크플로의 제품으로 설정하여 대체를 활성화합니다.

2장. Automation Services Catalog와의 통합을 지원하도록 플레이북 set_stats 필드 업데이트

플레이북을 업데이트하여 주문 프로세스 워크플로에서 Automation Services Catalog에 정보를 전달하고 제품 전체에 대체 가능한 변수를 지원할 수 있습니다.

2.1. Automation Services Catalog에 값을 반환하는 플레이북 작성

Automation Services Catalog에 값을 반환하도록 설계된 플레이북을 작성할 수 있습니다. expose_to _ cloud_redhat_com_ 을 접두사로 지정하면 해당 값을 Automation Services Catalog로 반환합니다. 그런 다음 대체 가능한 변수를 사용하여 해당 값을 추가 플레이북을 통해 전달할 수 있습니다.

아래 플레이북 예제를 사용하여 set_stats 값에 대해 알아보고 값을 Automation Services Catalog에 다시 전달하고 순서 프로세스에서 후속 플레이북에서 대체 값으로 사용합니다.

플레이북 주문하기 전 예

전에 플레이북이 즐겨 찾는 색상의 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"

제품 순서 플레이북의 예

이 플레이북은 대체 값을 다시 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}}"

플레이북 주문 후 예

아래 주문 후 플레이북 예제에는 제품 플레이북에서 전달한 artifact 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}}"
~

3장. 순서 프로세스를 사용하여 ITSM 통합에서 순차적 작업 정의

주문 프로세스는 사용자 순서 제품을 ITSM 시스템과 통합하는 기본 Automation Services 카탈로그 기능입니다. 주문 프로세스는 ITSM 시스템에서 작업을 수행하는 작업 템플릿을 실행하기 위한 Automation Services Catalog의 제품으로 구성됩니다. 이러한 프로세스는 순서 전과 순서 작업으로 구성됩니다. 사용자 주문 전후에 실행되도록 설계된 제품로서 주문 프로세스를 정의하여 주문 시퀀스에 걸쳐 정보가 전달됩니다.

순서 예

  • 주문 전 - ITSM 시스템에서 티켓을 생성하는 제품입니다.
  • 제품 순서 - 웹 서버.
  • 주문 후 - ITSM 시스템의 티켓을 닫습니다.

제품 또는 포트폴리오 수준에서 주문 프로세스를 생성하여 실행되는 순서와 제품을 정의합니다.

이 예제 워크플로의 경우 주문 프로세스를 생성하여 주문 순서,제품 순서, 주문 후 주문에 첨부해야 합니다.

3.1. 순서 프로세스 생성

카탈로그 관리자는 제품 순서 전과 후에 Ansible Tower 플레이북을 실행할 수 있는 순서 프로세스를 생성합니다.

사전 요구 사항

  • Ansible Tower 플레이북을 사용하여 주문 프로세스를 생성하려면 Ansible Tower 클러스터를 소스로 추가해야 합니다.

절차

  1. 기본 탐색 에서 주문 프로세스를 선택합니다.
  2. btn:[Create]를 클릭합니다.
  3. 순서 프로세스 이름 및 설명을 제공합니다.
  4. 드롭다운 메뉴에서 주문 프로비저닝 전과 후에 발생할 작업을 선택합니다.

    참고

    드롭다운 메뉴에는 Ansible Tower 소스에서 가져온 플레이북이 표시됩니다. 각 주문 프로세스에 대해 작업 전 및 후 작업 하나만 지원됩니다.

  5. 새 주문 프로세스 세부 정보를 검토한 다음 btn:[Create]를 클릭합니다.

3.2. 제품의 주문 프로세스 설정

단일 제품에 적용할 주문 프로세스를 설정합니다.

절차

  1. 기본 탐색 에서 제품을 선택한 다음 제품을 선택합니다.
  2. btn:[anchor actions]를 클릭하고 Set order processes 를 선택합니다.
  3. 드롭다운 메뉴를 확장하고 주문 프로세스를 선택합니다.

    참고

    Ansible Automation Platform은 현재 제품 프로비저닝당 하나의 주문 프로세스만 지원합니다.

  4. btn:[Save]를 클릭합니다.

4장. 순서 프로세스 워크플로우에서 대체 가능한 변수 활성화

순서 프로세스 워크플로에 사용된 제품 간에 변수를 대체할 수 있습니다. 대체 변수를 구현하려면 Ansible Tower에서 작업 템플릿 설문 조사를 생성 또는 편집하고 Automation Services Catalog의 제품에 첨부된 설문 조사를 대체할 수 있어야 합니다.

대체 형식 및 요구 사항

대체 값은 {{substitution_express}} 형식으로 표현되며, 중괄호와 표현식 사이에 공백을 사용할 수 없습니다. 대체에 사용할 수 있는 각 변수에 대한 정보는 대체 변수를 참조하십시오.

4.1. 순서 프로세스 워크플로에 대체 변수 구현

이 섹션에서는 이 가이드의 앞부분에서 제공한 플레이북 예제를 사용하여 플레이북에서 Automation Services Catalog에 노출하는 데이터를 대체 변수와 정렬하는 방법을 보여줍니다.

4.1.1. 제품 주문에 값을 전달하는 주문 프로세스 전 생성.

순서 전의 플레이북 before_order.yml 의 예

# 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"

이 플레이북은 Automation Services Catalog로 돌아가고 있는 플레이북 아티팩트 favorite_color돌아갑니다. 사용자 입력이 필요하지 않으므로 Ansible Tower에서 작업 템플릿 설문조사를 수행할 필요가 없습니다. 대신 주문 처리 전에 Automation Services Catalog에서 설문 조사를 편집하여 favorite_color 를 제품 플레이북에 전달할 수 있습니다.

4.1.2. 대체 변수를 사용하도록 제품 순서 구성

이 예제 제품 플레이북은 {{favorite_color}}의 대체 변수를 수락하고 다시 Automation Services Catalog에 아티팩트 'after_data'로 전달합니다.

플레이북 product_order.yml의 예

# 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}}"

'product_order.yml' 플레이북에 대한 Ansible Tower에 *Answer Variable Name으로 favorite_color 를 설정하는 작업 템플릿을 생성합니다.

다음을 포함하는 product_order.yml 작업 템플릿에 대한 설문조사를 생성합니다.

  1. 프롬프트 필드에 원하는 색상이 무엇입니까? 를 입력합니다.
  2. answer Variable Name 필드에 favorite_color 를 입력합니다.
  3. btn:[UPDATE]를 클릭합니다.

Automation Services Catalog에서 제품 주문 설문 조사를 활성화하여 before_order.yml 에서 전달된 'favorite_color' 값을 사용합니다.

귀하의 제품 주문에 포함된 설문 조사에서 :

  1. 다음 값으로 필드를 업데이트합니다.

    1. 이름: favorite_color
    2. 초기 값: {{before.before_order.artifacts.favorite_color}}
    3. 레이블: 가장 선호하는 색상은 무엇입니까?
    4. 자리 표시자: {{before.before_order.artifacts.favorite_color}}
  2. Disabled 스위치를 활성 위치로 전환합니다.
  3. Substitution 을 활성 위치로 전환합니다.

이제 before_ order.yml 플레이북의 favorite_color 아티팩트를 대체 변수로 사용하도록 제품 순서를 구성했습니다.

4.1.3. 제품 순서의 after _data 아티팩트 값을 수락하도록 제품 구성

설문조사를 사용하여 대체 가능한 변수를 사용하여 'product_order.yml' 아티팩트 after_dataafter_order.yml 에 전달합니다.

제품 주문 후의 플레이북 after_order.yml 의 예

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

after_data 를 *Answer Variable Name으로 설정하는 'after_order.yml' 플레이북에 대한 Ansible Tower에 작업 템플릿을 생성합니다.

after_order.yml 작업 템플릿에 연결된 설문 조사에서 다음을 수행합니다.

  1. 프롬프트 필드에 "Enter your after data"를 입력합니다.
  2. answer Variable Name 필드에 after_data 를 입력합니다.
  3. btn:[UPDATE]를 클릭합니다.

Automation Services Catalog의 주문 후 설문 조사를 활성화하여 after_order.yml 에서 전달된 'after_data' 값을 사용합니다.

주문 후 귀하의 설문 조사에서 :

  1. 다음 값으로 필드를 업데이트합니다.

    1. name: after_data
    2. 초기 값: {{product.artifacts.after_data}}
    3. 레이블: "데이터 후 입력"
    4. 자리 표시자: {{product.artifacts.after_data}}
  2. Disabled 스위치를 활성 위치로 전환합니다.
  3. Substitution 을 활성 위치로 전환합니다.

작업 템플릿이 실행될 때 Playbook은 데이터 이후에 전달된 값을 표시합니다.

4.2. 대체 변수 참조

대체 형식은 {{substitution_express}} 입니다. 중괄호와 표현식 사이에 공백을 사용하지 마십시오.

대체 값은 Ansible Tower 작업 템플릿 설문 조사에 설정됩니다. 대체 변수는 구성에 따라 순서대로 한 제품에서 다른 제품으로 전달됩니다.

작업 템플릿 설문 조사 업데이트에 대한 자세한 내용은 Ansible Tower 사용자 가이드 의 설문조사를 참조하십시오.

설문 조사에 대체 가능한 변수를 포함하는 경우 아래 표를 따르십시오.

표 4.1. 오브젝트 모델 참조 테이블

개체expression참고

순서

order.order_id

order.created_at

order.ordered_by.name

order.ordered_by.email

order.approval.updated_at

order.approval.decision

order.approval.reason

order.created_at'는 순서가 시작된 날짜 및 시간입니다.

날짜 형식: 2007-02-10T20:30:45Z

예: {{order.approval.reason}}

순서 전

before.<order_process_name>.artifacts.<fact_name>

before.<order_process_name>.parameters.<parameter_name>

before.<order_process_name>.status

공간이 포함된 경우 order_process_name에는 따옴표가 필요하지 않습니다.

예: {{before.Sample Order.artifacts.ticket_number}}

제품

product.name

product.description

product.long_description

product.help_url

product.support_url

product.vendor

product.platform

product.portfolio.name

product.portfolio.description

product.artifacts.<fact_name>

product.parameters.<parameter_name>

product.status

예: {{product.artifacts.after_data}}

주문 후

after.<order_process_name>.artifacts.<fact_name>

after.<order_process_name>.parameters.<parameter_name>

after.<order_process_name>.status

공간이 포함된 경우 order_process_name에는 따옴표가 필요하지 않습니다.

예: {{after.SampleOrder.status}}

법적 공지

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.