Skip to content

Commit 5761c26

Browse files
author
Fernando Lopez
committed
Update the automatic deployment with variable
1 parent 974153e commit 5761c26

3 files changed

Lines changed: 55 additions & 5 deletions

File tree

deploy/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ This content describes how to deploy this example of FIWARE services using an
66

77
It will install the service and the different configurations file in order
88
to make a prrof of concept of the integration of the different GEs (Orion,
9-
IdM - Keyrock, Wirecloud, IoT-Agent UL, Cygnus, PEP Proxy - Wilma and NGSI
10-
Proxy.
9+
IdM - Keyrock, Wirecloud, IoT-Agent UL, Cygnus, PEP Proxy - Wilma and NGSI Proxy.
1110

1211
Additionally, it autoconfigures the wirecloud instance in order to use the
1312
IdM - Keyrock local instance deployed in the docker-compose.
@@ -29,3 +28,9 @@ IdM - Keyrock local instance deployed in the docker-compose.
2928
ansible-playbook -vvvv -i inventory.yml \
3029
--private-key=(Key pair to access to the instance) \
3130
deploy_fiware.yml
31+
32+
* Once that the command finish, the last step is going into the virtual machine and execute the command:
33+
34+
sudo ./setup.sh init
35+
36+
Which automatically configure the Wirecloud to connect to the local instance of IdM.

deploy/deploy_fiware.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,38 @@
66
become: yes
77
# strategy: debug
88

9+
vars_files:
10+
- vars/main.yml
11+
12+
# Update and Upgrade the ubuntu instance
913
pre_tasks:
1014
- name: Update APT cache
1115
apt: update_cache=yes
1216

17+
- name: Upgrade packages
18+
apt: upgrade=dist
19+
20+
- name: Check if a reboot is required
21+
register: reboot_required_file
22+
stat: path=/var/run/reboot-required get_md5=no
23+
24+
- name: restart machine
25+
become: yes
26+
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
27+
async: 1
28+
poll: 0
29+
ignore_errors: true
30+
when: reboot_required_file.stat.exists == true
31+
32+
- name: Waiting for server to come back
33+
become: no
34+
local_action: wait_for
35+
port=22
36+
host={{ inventory_hostname }}
37+
search_regex=OpenSSH
38+
delay=10
39+
40+
1341
tasks:
1442
# General tasks, install vim
1543
- name: Install apt-transport-https, ca-certificates, curl, software-properties-common, ppa-purge, vim and NTP server
@@ -112,7 +140,7 @@
112140
- debug:
113141
msg: "{{ docker_compose.stdout }}"
114142

115-
# Clone repository
143+
# Clone repository, NOW IT WILL BE CHANGED TO JUST PUT THE FILE THAT WE NEED
116144
- git:
117145
repo: https://github.com/flopezag/docker-fiware.git
118146
dest: /home/ubuntu/docker-fiware
@@ -127,6 +155,20 @@
127155
shell: chown -R ubuntu:ubuntu /home/ubuntu/docker-fiware/
128156
become: true
129157

158+
- name: change the IP adress 127.0.0.1 by the public IP of the virtual machine in which we deploy the ansible in config-idm.sh
159+
replace:
160+
path: /home/ubuntu/docker-fiware/config-idm.sh
161+
regexp: 'fiware-idm'
162+
replace: '{{ ip_address }}'
163+
backup: yes
164+
165+
- name: change the IP adress 127.0.0.1 by the public IP of the virtual machine in which we deploy the ansible in setup.sh
166+
replace:
167+
path: /home/ubuntu/docker-fiware/setup.sh
168+
regexp: '127.0.0.1'
169+
replace: '{{ ip_address }}'
170+
backup: yes
171+
130172
# Lauch the docker-compose of the services and configure it
131173
- name: Run the docker-compose up of the service
132174
shell: docker-compose up -d
@@ -135,8 +177,7 @@
135177
chdir: /home/ubuntu/docker-fiware
136178

137179
- name: Configurte the IdM and Wirecloud to work together
138-
shell: setup.sh init
180+
shell: ./setup.sh init
139181
become: true
140182
args:
141183
chdir: /home/ubuntu/docker-fiware
142-

deploy/vars/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
# IP address of the virtual machine in which
3+
# this ansible is deployed
4+
ip_address: <IP of the Virtual Machine>

0 commit comments

Comments
 (0)