File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 5252 loop : " {{ __gcp_subnets_discovered.resources }}"
5353 loop_control :
5454 loop_var : __gcp_subnet_item
55-
56- - name : Discover GCP Cross Account Service Account Keys
57- register : __gcp_xaccount_sa_discovered
58- failed_when :
59- - __gcp_xaccount_sa_discovered.rc == 1
60- - " 'NOT_FOUND:' not in __gcp_xaccount_sa_discovered.stderr"
61- - " 'Permission iam.serviceAccountKeys.list' not in __gcp_xaccount_sa_discovered.stderr"
62- command : >
63- gcloud iam service-accounts keys list
64- --iam-account "{{ plat__gcp_xaccount_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com"
65- --format="json"
66-
67- - name : Set discovered Cross Account Service Account keys if exists
68- when :
69- - __gcp_xaccount_sa_discovered is defined
70- - __gcp_xaccount_sa_discovered.stdout is defined
71- - __gcp_xaccount_sa_discovered.stdout | length > 0
72- ansible.builtin.set_fact :
73- plat__gcp_xaccount_keys : " {{ __gcp_xaccount_sa_discovered.stdout | from_json }}"
Original file line number Diff line number Diff line change 1212# distributed under the License is distributed on an "AS IS" BASIS,
1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
15- # limitations under the License.
15+ # limitations under the License.
16+
17+ - name : Discover GCP Cross Account Service Account Keys
18+ register : __gcp_xaccount_sa_discovered
19+ failed_when :
20+ - __gcp_xaccount_sa_discovered.rc == 1
21+ - " 'NOT_FOUND:' not in __gcp_xaccount_sa_discovered.stderr"
22+ - " 'Permission iam.serviceAccountKeys.list' not in __gcp_xaccount_sa_discovered.stderr"
23+ command : >
24+ gcloud iam service-accounts keys list
25+ --iam-account "{{ plat__gcp_xaccount_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com"
26+ --format="json"
27+
28+ - name : Set discovered Cross Account Service Account keys if exists
29+ when :
30+ - __gcp_xaccount_sa_discovered is defined
31+ - __gcp_xaccount_sa_discovered.stdout is defined
32+ - __gcp_xaccount_sa_discovered.stdout | length > 0
33+ ansible.builtin.set_fact :
34+ plat__gcp_xaccount_keys : " {{ __gcp_xaccount_sa_discovered.stdout | from_json }}"
You can’t perform that action at this time.
0 commit comments