mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-23 13:20:30 -07:00
Creating Service Accounts (#125)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
8dbbba47cc
commit
ff78ac3b85
4 changed files with 72 additions and 56 deletions
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
resource_name: "{{ resource_prefix }}"
|
||||
sa_name: sa-{{ 100000 | random }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
# defaults file
|
||||
resource_name: '{{resource_prefix}}'
|
||||
|
|
|
@ -15,21 +15,21 @@
|
|||
# Pre-test setup
|
||||
- name: delete a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -50,12 +50,12 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
- name: create a service account that already exists
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
|
@ -64,12 +64,12 @@
|
|||
#----------------------------------------------------------
|
||||
- name: delete a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -90,12 +90,12 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
- name: delete a service account that does not exist
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue