Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: provision stack
- hosts: localhost
- connection: local
- gather_facts: false
- # Launch the cloudformation-example.yml template. Register the output.
- tasks:
- - name: launch ansible cloudformation example
- cloudformation: >
- stack_name="ansible-cloudformation" state=present
- region=us-east-1 disable_rollback=true
- template=files/simple-rds.yml
- args:
- template_parameters:
- vpcid: vpc-0123456
- application: abc
- appSubnetCidr1: 201.0.0.0/20
- appSubnetCidr2: 201.0.0.0/22
- dbCreateNewParamsGroup: true
- dbInstanceType: db.t2.micro
- dbName: testdb
- dbSubnetId1: subnet-87654321
- dbSubnetId2: subnet-12345678
- dbUsername: master_user
- environment: development
- product: ""
- dbPassword: ""
- techContact: ""
- register: stack
- - name: show stack events
- debug: msg="My stack events are {{stack.events}}"
- FROM ubuntu:18.04
- # File Author / Maintainer
- # Install ansible
- RUN apt-get update
- RUN apt-get install software-properties-common -y
- RUN apt-get update
- #RUN apt-add-repository -y ppa:ansible/ansible
- #RUN apt-get update
- RUN apt-get -y install ansible
- # Install Pip
- RUN apt install python-pip -y
- # Install boto3
- RUN pip install boto3
- # Install boto
- RUN pip install boto
- stages:
- - build
- build:master:
- image: vrathore/ansibleimage:latest
- script:
- - touch ~/.boto
- - echo "[Credentials]" > ~/.boto
- - echo "aws_access_key_id = AKIAIACZXXXXXXXXXXXX" >> ~/.boto
- - echo "aws_secret_access_key = P5lO8H9tXXXXXXXXXXXXX" >> ~/.boto
- - cp simple-rds.yml /etc/ansible/playbook/files/simple-rds.yml
- - cp eb_playbook.yml /etc/ansible/playbook/eb_playbook.yml
- - cd /etc/ansible/playbook && ansible-playbook eb_playbook.yml -vvv
- stage: build
- only:
- - master
- cp: cannot stat 'simple-rds.yml': No such file or directory
Add Comment
Please, Sign In to add comment