forked from devops-recipes/prov_aws_vpc_ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshippable.yml
52 lines (49 loc) · 1.46 KB
/
shippable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
resources:
# Automation scripts repo
- name: aws_vpc_repo
type: gitRepo
integration: "drship_github"
versionTemplate:
sourceName: "devops-recipes/prov_aws_vpc_ansible"
branch: master
# AWS CLI config
- name: aws_creds
type: integration
integration: "dr_aws"
# Output of VPC provisioning
- name: aws_vpc_info
type: params
versionTemplate:
params:
SEED: "initial_version"
jobs:
# Provision AWS VPC with Ansible
- name: prov_aws_vpc_ans
type: runSh
steps:
- IN: aws_vpc_repo
- IN: aws_creds
switch: off
- TASK:
name: prov_vpc
runtime:
options:
env:
- STATE_RES_NAME: "aws_vpc_info"
- vpc_region: "us-east-1"
- vpc_name: "demo_vpc"
- vpc_cidr_block: "10.10.0.0/16"
- vpc_access_from_ip_range: "0.0.0.0/0"
- vpc_public_subnet_1_cidr: "10.10.10.0/24"
script:
- pushd $(shipctl get_resource_state "aws_vpc_repo")/ansible
- export AWS_ACCESS_KEY_ID=$(shipctl get_integration_resource_field aws_creds "accessKey")
- export AWS_SECRET_ACCESS_KEY=$(shipctl get_integration_resource_field aws_creds "secretKey")
- shipctl replace variables.yml
- ansible-playbook -v vpc_prov_playbook.yml
- OUT: aws_vpc_info
overwrite: true
flags:
- aws_vpc
- aws
- ansible