Skip to content

Instantly share code, notes, and snippets.

@stefanhorning
Created October 17, 2018 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanhorning/784d5af4f6430a89e9976480eb68d3fa to your computer and use it in GitHub Desktop.
Save stefanhorning/784d5af4f6430a89e9976480eb68d3fa to your computer and use it in GitHub Desktop.
Ansible play to test aws_codepipeline module
- name: Playbook to test CodePipeline module
hosts: localhost
vars:
aws_region: us-east-1
codebuild_iam_role_arn: 'arn:aws:iam::XXX:role/codepipeline-service-role'
tasks:
- name: CodePipeline project task
aws_codepipeline:
name: test-ansible
role_arn: "{{ codebuild_iam_role_arn }}"
artifact_store:
type: S3
location: foo
stages:
- name: step_1
actions:
- name: action
actionTypeId:
category: Source
owner: AWS
provider: S3
version: '1'
configuration:
S3Bucket: foo
S3ObjectKey: bar
outputArtifacts:
- { name: step_one_output }
- name: step_2
actions:
- name: action
actionTypeId:
category: Build
owner: AWS
provider: CodeBuild
version: '1'
inputArtifacts:
- { name: step_one_output }
outputArtifacts:
- { name: step_two_output }
configuration:
ProjectName: foo
region: "{{ aws_region }}"
state: present
register: output
- name: Debug out
debug:
var: output
@stefanhorning
Copy link
Author

Note: IAM role must exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment