community.sap_libs.sapcar_extract 模块 – 管理 SAP SAPCAR 归档文件

注意

此模块是 community.sap_libs 集合 (版本 1.4.2) 的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.sap_libs

要在剧本中使用它,请指定: community.sap_libs.sapcar_extract

community.sap_libs 1.0.0 中的新增功能

概要

  • 提供对使用 SAP 的 SAPCAR 二进制文件解包 sar/car 文件并将信息提取回 Ansible 的支持。

参数

参数

注释

binary_path

路径

SAPCAR 二进制文件的路径,例如 /home/dummy/sapcarhttps://myserver/SAPCAR。如果未提供此参数,模块将在 PATH 中查找。

dest

路径

SAPCAR 解包 SAR 文件的目标位置。将创建缺少的文件夹。如果未提供此参数,它将在与 SAR 文件相同的文件夹中解包。

manifest

字符串

清单的名称。

默认值: "SIGNATURE.SMF"

路径

路径 / 必填

SAR/CAR 文件的路径。

remove

布尔值

如果为 true,则将删除 SAR/CAR 文件。应谨慎使用此选项!

选项

  • false ← (默认)

  • true

security_library

路径

安全库的路径,例如 /usr/sap/hostctrl/exe/libsapcrytp.so,用于签名操作。

signature

布尔值

如果为 true,则将提取签名。

选项

  • false ← (默认)

  • true

备注

注意

  • check_mode 中始终返回 changed=true

示例

- name: Extract SAR file
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"

- name: Extract SAR file with destination
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"
    dest: "~/test/"

- name: Extract SAR file with destination and download from webserver can be a fileshare as well
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"
    dest: "~/dest/"
    binary_path: "https://myserver/SAPCAR"

- name: Extract SAR file and delete SAR after extract
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"
    remove: true

- name: Extract SAR file with manifest
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"
    signature: true

- name: Extract SAR file with manifest and rename it
  community.sap_libs.sapcar_extract:
    path: "~/source/hana.sar"
    manifest: "MyNewSignature.SMF"
    signature: true

作者

  • Rainer Leber (@RainerLeber)