forked from prakhar1985/ansible_homework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_provision.yml
50 lines (47 loc) · 1.44 KB
/
aws_provision.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
---
- hosts: workstation
become: true
gather_facts: false
tasks:
- name: create bin directory
file:
path: /root/bin
state: directory
- name: get script common.sh
get_url:
url: "{{ param_repo_base }}/scripts/common.sh"
dest: /root/common.sh
mode: 0755
- name: get script jq
get_url:
url: "{{ param_repo_base }}/scripts/jq-linux64"
dest: /root/bin/jq
mode: 0755
- name: get script order_svc.sh
get_url:
url: "{{ param_repo_base }}/scripts/order_svc.sh"
dest: /root/order_svc.sh
mode: 0755
- name: create credentials
copy:
content: |
export username={{ param_user }}
export password={{ param_password }}
export uri=https://labs.opentlc.com
dest: /root/credential.rc
mode: 0755
# Fix the existing shell scripts to reference jq command with bin/jq
- name: fix scripts
shell: "sed -i 's/ jq/ bin\\/jq/g' {{ item }}"
with_items:
- /root/common.sh
- /root/order_svc.sh
# Using this script will always deploy environments in the us-east-1 region.
# TODO: this shell task is not working yet!
- name: order service on opentlc
shell: source /root/credential.rc; /root/order_svc.sh -y -c 'OPENTLC Automation' -i 'Three Tier Application' -t 1
args:
chdir: /root
- name: Wait for mail
pause:
minutes: 10