|
6 | 6 | become: yes |
7 | 7 | # strategy: debug |
8 | 8 |
|
| 9 | + vars_files: |
| 10 | + - vars/main.yml |
| 11 | + |
| 12 | + # Update and Upgrade the ubuntu instance |
9 | 13 | pre_tasks: |
10 | 14 | - name: Update APT cache |
11 | 15 | apt: update_cache=yes |
12 | 16 |
|
| 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 | + |
13 | 41 | tasks: |
14 | 42 | # General tasks, install vim |
15 | 43 | - name: Install apt-transport-https, ca-certificates, curl, software-properties-common, ppa-purge, vim and NTP server |
|
112 | 140 | - debug: |
113 | 141 | msg: "{{ docker_compose.stdout }}" |
114 | 142 |
|
115 | | - # Clone repository |
| 143 | + # Clone repository, NOW IT WILL BE CHANGED TO JUST PUT THE FILE THAT WE NEED |
116 | 144 | - git: |
117 | 145 | repo: https://github.com/flopezag/docker-fiware.git |
118 | 146 | dest: /home/ubuntu/docker-fiware |
|
127 | 155 | shell: chown -R ubuntu:ubuntu /home/ubuntu/docker-fiware/ |
128 | 156 | become: true |
129 | 157 |
|
| 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 | + |
130 | 172 | # Lauch the docker-compose of the services and configure it |
131 | 173 | - name: Run the docker-compose up of the service |
132 | 174 | shell: docker-compose up -d |
|
135 | 177 | chdir: /home/ubuntu/docker-fiware |
136 | 178 |
|
137 | 179 | - name: Configurte the IdM and Wirecloud to work together |
138 | | - shell: setup.sh init |
| 180 | + shell: ./setup.sh init |
139 | 181 | become: true |
140 | 182 | args: |
141 | 183 | chdir: /home/ubuntu/docker-fiware |
142 | | - |
|
0 commit comments