如何将GCP项目载入Ansible Tower,以便在其中运行剧本?

如何将GCP项目载入Ansible Tower,以便在其中运行剧本?,ansible,ansible-tower,Ansible,Ansible Tower,我已经成功地使用Ansible引擎提供GCP资源,使用Ansible剧本和GCP模块 现在我正试图使用Ansible Tower来实现这一点,而我对Ansible Tower完全是新手 我无法理解如何在Ansible Tower中为GCP创建库存。在tower中,我们可以提供运行yaml的主机。如何确定GCP的主机IP?用例: 我想提供一个GCP计算引擎 我想提供一个Bigquery数据集和表 在这两种情况下,我在ansible tower的主人应该是什么?有人能帮忙吗?创建一个凭证连接到GCP

我已经成功地使用Ansible引擎提供GCP资源,使用Ansible剧本和GCP模块

现在我正试图使用Ansible Tower来实现这一点,而我对Ansible Tower完全是新手

我无法理解如何在Ansible Tower中为GCP创建库存。在tower中,我们可以提供运行yaml的主机。如何确定GCP的主机IP?用例:

  • 我想提供一个GCP计算引擎
  • 我想提供一个Bigquery数据集和表

  • 在这两种情况下,我在ansible tower的主人应该是什么?有人能帮忙吗?

    创建一个
    凭证
    连接到GCP,如下所示

    - Name: GCP Credentials
    - Description: GCP Credentials
    - Organization: Default
    - Credential Type: Google Compute Engine
    - Service Account Email Address: *This will be filled when upload json file*
    - Project: *This will be filled when upload json file*
    - Service Account Json File: yourfile.json
    - RSA Private Key: *This will be filled when upload json file*
    
    创建
    库存
    如下并保存

    - Name: GCP Inventory
    - Description: GCP Inventory
    - Organization: Default
    
    然后,在
    Sources
    选项卡的
    Inventory
    中,单击
    的按钮创建一个新的源,其中包含以下信息:

    - Name: GCP Source
    - Description: GCP Source
    - Source: Google Compute Engine
    - Credential: GCP Credentials
    

    资源
    目录的
    选项卡中
    单击新资源的“启动同步过程”选项。这将更新您的
    主机
    。有了所有这些,你只需要在
    localhost
    上用一个模板使用这个凭证和清单来执行你的剧本。

    Wow,它就像魔术@Gary Lopez!非常感谢。虽然我已经设置了凭据、组织和库存,但我不知道如何为GCP设置主机。文档中也没有此信息。谢谢你!别担心,对于Ansible Tower的任何其他问题,我都很乐意支持你。