を発行し、私は私がこれを実行したときに私が得る、しかしAnsible http://docs.ansible.com/ansible/guide_gce.htmlAnsibleを使用してGCEインスタンスを作成し、権限が
を使用してインスタンスを作成するためのマニュアルを参照して、以下のよここでは、サービスアカウントのこれらのアクセス許可を構成することを意図しています。ドキュメントでは、既に作成されたインスタンスのサービスアカウントのアクセス許可のみを構成できることが示唆されているようです。 "インスタンス "
このサービスアカウント(管理者)のIAM権限を許可しようとすると、そのアカウントには含まれません。サービスアカウントでサービスアカウントを選択すると、ドメイン全体のアクセス許可のメンバーを追加するよう求められます。 compute.zones.listのこのサービスアカウントに権限を割り当てることができません
助けが必要ですか?そう
- name: Create instance(s)
hosts: localhost
gather_facts: no
connection: local
vars:
machine_type: n1-standard-1 # default
image: ubuntu-1404-lts
service_account_email: [email protected]
credentials_file: /Users/Mike/Downloads/project.json
project_id: quick-line-137923
tasks:
- name: Launch instances
gce:
instance_names: dev
machine_type: "{{ machine_type }}"
image: "{{ image }}"
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
tags: webserver
register: gce
- name: Wait for SSH to come up
wait_for: host={{ item.public_ip }} port=22 delay=10 timeout=60
with_items: gce.instance_data
- name: Add host to groupname
add_host: hostname={{ item.public_ip }} groupname=new_instances
with_items: gce.instance_data
- name: Manage new instances
vars_files:
- "vars/webserver.yml"
hosts: new_instances
connection: ssh
sudo: True
roles:
- geerlingguy.apache
- geerlingguy.php
- geerlingguy.drush
- geerlingguy.mysql
これを受け入れることが遅れて申し訳ありませんが、実際にこれを理解して質問に追加するのを忘れましたが、あなたの答えは私のものです。ありがとう! –