简体   繁体   English

如何从 GCP 项目 A 的 GCE 实例运行 ansible 以管理 GCP 项目 B、C、D 中的数百个 VM(无共享 VPC)

[英]How to run ansible from a GCE Instance from GCP Project A to manges hundreds of VMs in GCP Project B,C,D (no shared VPCs)

I have a VM (VCE Instance) in GCP (Google Cloud) in Project A (Let's call this "ansible_vm"), where I have my Ansible playbooks and inventories.我在项目 A 的 GCP(谷歌云)中有一个 VM(VCE 实例)(我们称之为“ansible_vm”),其中有我的 Ansible 剧本和清单。

I also have hundreds on VCE Instances in multiple projects (B,C,D etc).我在多个项目中也有数百个 VCE 实例(B、C、D 等)。

There are no Shared VPCs amongst these GCP projects.这些 GCP 项目中没有共享 VPC。

Is there way I can run ansible and ansible-playbook commands from the "ansible_vm" to manage the VMs in GCP Projects B,C,D etc?有没有办法我可以从“ansible_vm”运行 ansible 和 ansible-playbook 命令来管理 GCP 项目 B、C、D 等中的虚拟机? One problem I can see already is that I have no way to ssh from "ansible_vm" to the other VMs.我已经看到的一个问题是我无法从“ansible_vm”到其他虚拟机的 ssh。

Thanks!谢谢!

You can move VMs between projects ( link ), but since you have hundreds of instances, that's not viable.您可以在项目之间移动虚拟机( 链接),但由于您有数百个实例,因此这是不可行的。
Which leaves you with two options:这让您有两个选择:

  1. Use Shared VPC , and designate Project A as the host project and attach other projects as service projects .使用共享 VPC ,将项目 A指定为宿主项目,并将其他项目附加为服务项目

  2. Use VPC Network Peering .使用VPC 网络对等互连 This, however, has a relatively low limit of 25 networks.但是,这具有 25 个网络的相对较低的限制

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 gorm 从项目 B 中的 go1.12 Flex 实例连接到项目 A 中的 GCP PostgreSQL 11 DB - How do I connect to a GCP PostgreSQL 11 DB in Project A from a go1.12 Flex Instance in Project B using gorm 如何将 GCP 项目中的 MySQL 实例连接到 AWS Lambda function? - How to connect MySQL instance from GCP project to AWs Lambda function? GCP 共享 VPC:子网未从宿主项目共享到服务项目 - GCP Shared VPC : a subnet is not shared from host project to service project 从 GCP 项目连接到 AWS VPC 中的实例 - Connect from a GCP project to an instance in an AWS VPC 将 VPN 隧道从项目 A 移动到项目 B - GCP - Moving a VPN Tunnel from Project A to Project B - GCP GCP,terraform 安装在 GCP 项目-A“测试实例”实例上,使用 terraform 代码,如何在项目 B 上部署/创建实例? - GCP, terraform is installed on GCP project-A 'test-instance' instance, using terraform code, how to deploy/create instance on project-B? 将数据从 Postgres DB(GCP 项目 A)复制到另一个 Postgres DB(GCP 项目 B) - Copy data from Postgres DB (GCP Project A) to another Postgres DB (GCP Project B) compute.networks.get 从共享 VPC 服务项目创建 GCP 实例组? - compute.networks.get to create GCP Instance group from a Shared VPC service project? 无法从不同项目中的机器映像创建 gcp 实例 - Can not create gcp instance from machine image in a different project GCP部署实例因Ansible脚本而失败 - GCP deploy instance fails from ansible script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM