Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 1 | --- |
| 2 | # prereqs-common/tasks/main.yml |
| 3 | |
| 4 | - name: "Check here on failure: 'https://wiki.opencord.org/display/CORD/Troubleshooting+a+Build'" |
| 5 | pause: |
| 6 | seconds: 10 |
| 7 | |
| 8 | - name: Memory size Check |
| 9 | assert: |
| 10 | that: "ansible_memtotal_mb >= {{ min_memtotal_mb }}" |
| 11 | |
| 12 | - name: CPU quantity Check |
| 13 | assert: |
| 14 | that: "ansible_processor_vcpus >= {{ min_processor_vcpus }}" |
| 15 | |
| 16 | - name: CPU KVM Check |
| 17 | when: kvm_check |
| 18 | shell: "lsmod | grep kvm_" |
| 19 | |
| 20 | - name: DNS Lookup Check |
| 21 | shell: "dig +short {{ dns_check_domain }} | grep {{ dns_check_ipv4 }}" |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 22 | register: dns_lookup_check_result |
| 23 | until: dns_lookup_check_result.rc == 0 |
| 24 | retries: 3 |
| 25 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 26 | tags: |
| 27 | - skip_ansible_lint # tried assert + dig (below), but it fails quickly and won't loop |
| 28 | # assert: |
| 29 | # that: "{{ lookup('dig', dns_check_domain ) == dns_check_ipv4 }}" |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 30 | |
| 31 | - name: DNS Global Root Connectivity Check |
| 32 | shell: "dig @{{ item }} +trace +short {{ dns_check_domain }} | grep {{ dns_check_ipv4 }}" |
| 33 | with_items: "{{ dns_roots }}" |
Zack Williams | b96c725 | 2016-08-17 09:48:14 -0700 | [diff] [blame] | 34 | register: dns_global_check_result |
| 35 | until: dns_global_check_result.rc == 0 |
| 36 | retries: 3 |
| 37 | delay: 1 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 38 | tags: |
| 39 | - skip_ansible_lint # too complex for lookup('dig', ...) to handle |
Zack Williams | 82c88e9 | 2016-08-08 13:54:20 -0700 | [diff] [blame] | 40 | |
| 41 | - name: HTTP Download Check |
| 42 | get_url: |
| 43 | url: "{{ http_dl_url }}" |
| 44 | checksum: "{{ http_dl_cksum }}" |
| 45 | dest: /tmp/http_dl_check |
| 46 | |
| 47 | - name: HTTPS Download Check |
| 48 | get_url: |
| 49 | url: "{{ https_dl_url }}" |
| 50 | checksum: "{{ https_dl_cksum }}" |
| 51 | dest: /tmp/https_dl_check |
| 52 | |