Debian Codegraph @

ansible_collections/amazon/aws/tests/integration/targets/callback_aws_resource_actions/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 export ANSIBLE_CALLBACK_WHITELIST="aws_resource_actions"
6
7 OUTFILE="callback_aws_resource_actions.out"
8 trap 'rm -rvf "${OUTFILE}" "${OUTFILE}.actions"' EXIT
9
10 # Tests that the resource_actions are added to each task
11 ansible-playbook main.yml -i localhost "$@" | tee "${OUTFILE}"
12
13 # There should be a summary at the end of the run with the actions performed:
14 # AWS ACTIONS: ['ec2:DescribeAvailabilityZones', 'ec2:DescribeInstances', 'iam:ListAccountAliases', 'sts:GetCallerIdentity']
15 grep -E "AWS ACTIONS: \[" "${OUTFILE}" > "${OUTFILE}.actions"
16 for action in 'ec2:DescribeAvailabilityZones' 'ec2:DescribeInstances' 'iam:ListAccountAliases' 'sts:GetCallerIdentity'
17 do
18 grep "${action}" "${OUTFILE}.actions"
19 done