Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 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 Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 17 | --- |
| 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 Williams | 3b0c82c | 2017-11-03 11:07:08 -0700 | [diff] [blame] | 37 | shell: "dig +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'" |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 38 | register: dns_lookup_check_result |
| 39 | until: dns_lookup_check_result.rc == 0 |
| 40 | retries: 3 |
| 41 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 42 | 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 Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 46 | |
| 47 | - name: DNS Global Root Connectivity Check |
Zack Williams | 3b0c82c | 2017-11-03 11:07:08 -0700 | [diff] [blame] | 48 | shell: "dig @{{ item }} +trace +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'" |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 49 | with_items: |
| 50 | - 192.5.5.241 |
| 51 | - 198.41.0.4 |
| 52 | - 199.7.91.13 |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 53 | register: dns_global_check_result |
| 54 | until: dns_global_check_result.rc == 0 |
| 55 | retries: 3 |
| 56 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 57 | tags: |
| 58 | - skip_ansible_lint # too complex for lookup('dig', ...) to handle |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 59 | |
| 60 | - name: HTTP Download Check |
| 61 | get_url: |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 62 | url: "http://cord.staging.wpengine.com/wp-content/uploads/2016/07/cord-tm-logo.png" |
| 63 | checksum: "sha256:099c777e4c8ad76a066299159622b4fa6bd2515cefafc2851df67f7f4cce6ee8" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 64 | dest: /tmp/http_dl_check |
Zack Williams | 1396aa3 | 2017-06-06 10:28:29 -0700 | [diff] [blame] | 65 | retries: 3 |
| 66 | delay: 1 |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 67 | |
| 68 | - name: HTTPS Download Check |
| 69 | get_url: |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 70 | url: "https://jenkins.opencord.org/static/8d0f081d/images/headshot.png" |
| 71 | checksum: "sha256:690e82fb98ffb2b4b232d9b9cf9cc52eb7972e56a84902f6d1150b75456058c6" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 72 | dest: /tmp/https_dl_check |
Zack Williams | 1396aa3 | 2017-06-06 10:28:29 -0700 | [diff] [blame] | 73 | retries: 3 |
| 74 | delay: 1 |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 75 | |