[英]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:这让您有两个选择:
Use Shared VPC , and designate Project A as the host project and attach other projects as service projects .使用共享 VPC ,将项目 A指定为宿主项目,并将其他项目附加为服务项目。
Use VPC Network Peering .使用VPC 网络对等互连。 This, however, has a relatively low limit of 25 networks.但是,这具有 25 个网络的相对较低的限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.