Skip to content

Commit

Permalink
Follow up on ansible-collections#167 - (permission preservation when …
Browse files Browse the repository at this point in the history
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification
  • Loading branch information
tremble authored Jul 31, 2020
1 parent b34d2b2 commit 0bad2c0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tests/integration/targets/lambda/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@
- name: move lambda into place for archive module
copy:
src: mini_lambda.py
dest: '{{output_dir}}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.py'
mode: preserve
- name: bundle lambda into a zip
register: zip_res
archive:
format: zip
path: '{{output_dir}}/mini_lambda.py'
dest: '{{output_dir}}/mini_lambda.zip'
path: '{{ output_dir }}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.zip'
- name: test state=present - upload the lambda
lambda:
name: '{{lambda_function_name}}'
name: '{{ lambda_function_name }}'
runtime: python2.7
handler: mini_lambda.handler
role: ansible_lambda_role
zip_file: '{{zip_res.dest}}'
zip_file: '{{ zip_res.dest }}'
register: result
- name: assert lambda upload succeeded
assert:
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/targets/lambda_policy/aliases
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
cloud/aws
shippable/aws/group1
# https://github.com/ansible-collections/community.aws/issues/155
unstable
6 changes: 3 additions & 3 deletions tests/integration/targets/lambda_policy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
- name: move lambda into place for archive module
copy:
src: mini_http_lambda.py
dest: '{{output_dir}}/mini_http_lambda.py'
dest: '{{ output_dir }}/mini_http_lambda.py'
mode: preserve
- name: bundle lambda into a zip
register: zip_res
archive:
format: zip
path: '{{output_dir}}/mini_http_lambda.py'
dest: '{{output_dir}}/mini_http_lambda.zip'
path: '{{ output_dir }}/mini_http_lambda.py'
dest: '{{ output_dir }}/mini_http_lambda.zip'
- name: create minimal lambda role
iam_role:
aws_region: '{{ aws_region }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
- name: move lambda into place for archive module
copy:
src: mini_lambda.py
dest: '{{output_dir}}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.py'
mode: preserve
- name: bundle lambda into a zip
register: function_res
archive:
format: zip
path: '{{output_dir}}/mini_lambda.py'
dest: '{{output_dir}}/mini_lambda.zip'
path: '{{ output_dir }}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.zip'
- name: register bucket
s3_bucket:
aws_access_key: '{{ aws_access_key }}'
Expand Down

0 comments on commit 0bad2c0

Please sign in to comment.