Zack Williams | 54f198d | 2017-12-22 10:12:46 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 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 | |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 16 | # prereqs-common/tasks/main.yml |
| 17 | |
Zack Williams | 54f198d | 2017-12-22 10:12:46 -0700 | [diff] [blame] | 18 | - name: "Check here on failure: 'https://guide.opencord.org/troubleshooting.html#prereqs-common-failures'" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 19 | pause: |
| 20 | seconds: 10 |
| 21 | |
| 22 | - name: Memory size Check |
| 23 | assert: |
| 24 | that: "ansible_memtotal_mb >= {{ min_memtotal_mb }}" |
| 25 | |
| 26 | - name: CPU quantity Check |
| 27 | assert: |
| 28 | that: "ansible_processor_vcpus >= {{ min_processor_vcpus }}" |
| 29 | |
| 30 | - name: CPU KVM Check |
| 31 | when: kvm_check |
| 32 | shell: "lsmod | grep kvm_" |
| 33 | |
| 34 | - name: DNS Lookup Check |
Zack Williams | 9512876 | 2017-11-03 11:07:08 -0700 | [diff] [blame] | 35 | shell: "dig +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'" |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 36 | register: dns_lookup_check_result |
| 37 | until: dns_lookup_check_result.rc == 0 |
| 38 | retries: 3 |
| 39 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 40 | tags: |
| 41 | - skip_ansible_lint # tried assert + dig (below), but it fails quickly and won't loop |
| 42 | # assert: |
| 43 | # that: "{{ lookup('dig', dns_check_domain ) == dns_check_ipv4 }}" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 44 | |
| 45 | - name: DNS Global Root Connectivity Check |
Zack Williams | 9512876 | 2017-11-03 11:07:08 -0700 | [diff] [blame] | 46 | shell: "dig @{{ item }} +trace +short {{ dns_check_domain }} | grep '{{ dns_check_record }}'" |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 47 | with_items: |
| 48 | - 192.5.5.241 |
| 49 | - 198.41.0.4 |
| 50 | - 199.7.91.13 |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 51 | register: dns_global_check_result |
| 52 | until: dns_global_check_result.rc == 0 |
| 53 | retries: 3 |
| 54 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 55 | tags: |
| 56 | - skip_ansible_lint # too complex for lookup('dig', ...) to handle |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 57 | |
| 58 | - name: HTTP Download Check |
| 59 | get_url: |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 60 | url: "http://cord.staging.wpengine.com/wp-content/uploads/2016/07/cord-tm-logo.png" |
| 61 | checksum: "sha256:099c777e4c8ad76a066299159622b4fa6bd2515cefafc2851df67f7f4cce6ee8" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 62 | dest: /tmp/http_dl_check |
Zack Williams | 1396aa3 | 2017-06-06 10:28:29 -0700 | [diff] [blame] | 63 | retries: 3 |
| 64 | delay: 1 |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 65 | |
| 66 | - name: HTTPS Download Check |
| 67 | get_url: |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 68 | url: "https://jenkins.opencord.org/static/8d0f081d/images/headshot.png" |
| 69 | checksum: "sha256:690e82fb98ffb2b4b232d9b9cf9cc52eb7972e56a84902f6d1150b75456058c6" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 70 | dest: /tmp/https_dl_check |
Zack Williams | 1396aa3 | 2017-06-06 10:28:29 -0700 | [diff] [blame] | 71 | retries: 3 |
| 72 | delay: 1 |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 73 | |