blob: df9e643083b9a37f58f734a19e8cf159baf6ec63 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
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
16
Zack Williams82c88e92016-08-08 13:54:20 -070017---
18# prereqs-common/tasks/main.yml
19
20- name: "Check here on failure: 'https://wiki.opencord.org/display/CORD/Troubleshooting+a+Build'"
21 pause:
22 seconds: 10
23
24- name: Memory size Check
25 assert:
26 that: "ansible_memtotal_mb >= {{ min_memtotal_mb }}"
27
28- name: CPU quantity Check
29 assert:
30 that: "ansible_processor_vcpus >= {{ min_processor_vcpus }}"
31
32- name: CPU KVM Check
33 when: kvm_check
34 shell: "lsmod | grep kvm_"
35
36- name: DNS Lookup Check
Zack Williams3b0c82c2017-11-03 11:07:08 -070037 shell: "dig +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'"
Zack Williamsb96c7252016-08-17 09:48:14 -070038 register: dns_lookup_check_result
39 until: dns_lookup_check_result.rc == 0
40 retries: 3
41 delay: 1
Zack Williams35624562016-08-28 17:12:26 -070042 tags:
43 - skip_ansible_lint # tried assert + dig (below), but it fails quickly and won't loop
44 # assert:
45 # that: "{{ lookup('dig', dns_check_domain ) == dns_check_ipv4 }}"
Zack Williams82c88e92016-08-08 13:54:20 -070046
47- name: DNS Global Root Connectivity Check
Zack Williams3b0c82c2017-11-03 11:07:08 -070048 shell: "dig @{{ item }} +trace +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'"
Zack Williams79286962017-07-10 12:24:37 -070049 with_items:
50 - 192.5.5.241
51 - 198.41.0.4
52 - 199.7.91.13
Zack Williamsb96c7252016-08-17 09:48:14 -070053 register: dns_global_check_result
54 until: dns_global_check_result.rc == 0
55 retries: 3
56 delay: 1
Zack Williams35624562016-08-28 17:12:26 -070057 tags:
58 - skip_ansible_lint # too complex for lookup('dig', ...) to handle
Zack Williams82c88e92016-08-08 13:54:20 -070059
60- name: HTTP Download Check
61 get_url:
Zack Williams79286962017-07-10 12:24:37 -070062 url: "http://cord.staging.wpengine.com/wp-content/uploads/2016/07/cord-tm-logo.png"
63 checksum: "sha256:099c777e4c8ad76a066299159622b4fa6bd2515cefafc2851df67f7f4cce6ee8"
Zack Williams82c88e92016-08-08 13:54:20 -070064 dest: /tmp/http_dl_check
Zack Williams1396aa32017-06-06 10:28:29 -070065 retries: 3
66 delay: 1
Zack Williams82c88e92016-08-08 13:54:20 -070067
68- name: HTTPS Download Check
69 get_url:
Zack Williams79286962017-07-10 12:24:37 -070070 url: "https://jenkins.opencord.org/static/8d0f081d/images/headshot.png"
71 checksum: "sha256:690e82fb98ffb2b4b232d9b9cf9cc52eb7972e56a84902f6d1150b75456058c6"
Zack Williams82c88e92016-08-08 13:54:20 -070072 dest: /tmp/https_dl_check
Zack Williams1396aa32017-06-06 10:28:29 -070073 retries: 3
74 delay: 1
Zack Williams82c88e92016-08-08 13:54:20 -070075