Feature 8623
[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 - name: Pre-configure iptables persistent
36   debconf: name=iptables-persistent question={{ item }} vtype=boolean value=true
37   become: yes
38   with_items:
39   - iptables-persistent/autosave_v4
40   - iptables-persistent/autosave_v6
41
42 - debug:
43     var: installer_args
44     verbosity: 2
45
46 - name: Install and configure OSM (It may require 10 min or more!)
47   shell:
48     cmd: ./install_osm.sh -y {{installer_args}} 2>&1 | tee osm_install_log.txt
49   args:
50     executable: /bin/bash
51   register: osm_installation_results
52   environment:
53     PATH: "/snap/bin:{{ ansible_env.PATH }}"
54   when: curl_result is failed
55
56 - debug:
57     var: osm_installation_results
58     verbosity: 2
59
60 - name: Check OSM reachability
61   uri:
62     url: http://localhost
63   register: curl_result