Guest User

Untitled

a guest
Oct 6th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. - name: provision stack
  2. hosts: localhost
  3. connection: local
  4. gather_facts: false
  5.  
  6. # Launch the cloudformation-example.yml template. Register the output.
  7.  
  8. tasks:
  9. - name: launch ansible cloudformation example
  10. cloudformation: >
  11. stack_name="ansible-cloudformation" state=present
  12. region=us-east-1 disable_rollback=true
  13. template=files/simple-rds.yml
  14. args:
  15. template_parameters:
  16. vpcid: vpc-0123456
  17. application: abc
  18. appSubnetCidr1: 201.0.0.0/20
  19. appSubnetCidr2: 201.0.0.0/22
  20. dbCreateNewParamsGroup: true
  21. dbInstanceType: db.t2.micro
  22. dbName: testdb
  23. dbSubnetId1: subnet-87654321
  24. dbSubnetId2: subnet-12345678
  25. dbUsername: master_user
  26. environment: development
  27. product: ""
  28. dbPassword: ""
  29. techContact: ""
  30. register: stack
  31. - name: show stack events
  32. debug: msg="My stack events are {{stack.events}}"
  33.  
  34. FROM ubuntu:18.04
  35. # File Author / Maintainer
  36.  
  37. # Install ansible
  38. RUN apt-get update
  39. RUN apt-get install software-properties-common -y
  40. RUN apt-get update
  41. #RUN apt-add-repository -y ppa:ansible/ansible
  42. #RUN apt-get update
  43. RUN apt-get -y install ansible
  44.  
  45. # Install Pip
  46. RUN apt install python-pip -y
  47.  
  48. # Install boto3
  49. RUN pip install boto3
  50.  
  51. # Install boto
  52. RUN pip install boto
  53.  
  54. stages:
  55. - build
  56.  
  57. build:master:
  58. image: vrathore/ansibleimage:latest
  59. script:
  60. - touch ~/.boto
  61. - echo "[Credentials]" > ~/.boto
  62. - echo "aws_access_key_id = AKIAIACZXXXXXXXXXXXX" >> ~/.boto
  63. - echo "aws_secret_access_key = P5lO8H9tXXXXXXXXXXXXX" >> ~/.boto
  64. - cp simple-rds.yml /etc/ansible/playbook/files/simple-rds.yml
  65. - cp eb_playbook.yml /etc/ansible/playbook/eb_playbook.yml
  66. - cd /etc/ansible/playbook && ansible-playbook eb_playbook.yml -vvv
  67. stage: build
  68. only:
  69. - master
  70.  
  71. cp: cannot stat 'simple-rds.yml': No such file or directory
Add Comment
Please, Sign In to add comment