Ansible installer update
[osm/devops.git] / installers / openstack / roles / osm_installation / tasks / main.yml
1 ---
2 #   Copyright 2020 British Telecommunications plc
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 #   Author: Antonio Marsico (antonio.marsico@bt.com)
16
17 - name: Waiting target connection to become reachable/usable
18   wait_for_connection:
19
20 - name: Gathering facts
21   setup:
22
23 - name: Copy OSM installer
24   copy:
25     src: "{{ osm_installer_path }}"
26     dest: install_osm.sh
27     mode: '744'
28
29 - name: Check OSM reachability
30   uri:
31     url: http://localhost
32   ignore_errors: yes
33   register: curl_result
34
35 - debug:
36     var: installer_args
37     verbosity: 2
38
39 - name: Install and configure OSM (It may require 10 min or more!)
40   shell:
41     cmd: ./install_osm.sh -y {{installer_args}} 2>&1 | tee osm_install_log.txt
42   args:
43     executable: /bin/bash
44   register: osm_installation_results
45   environment:
46     PATH: "/snap/bin:{{ ansible_env.PATH }}"
47   when: curl_result is failed
48
49 - debug:
50     var: osm_installation_results
51     verbosity: 2
52
53 - name: Check OSM reachability
54   uri:
55     url: http://localhost
56   register: curl_result