summaryrefslogtreecommitdiffstats
path: root/ansible/roles/infra_check_requirements
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-03-08 09:54:35 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-08 09:54:35 +0000
commit9c50ed0e9bdb4dec5a95af40eb0e89ee962fcd40 (patch)
treebbe6743a7d3ee2db2a2b844e7f7f44b3761e5240 /ansible/roles/infra_check_requirements
parentd5a2c20d8de2796b2d2e2143ddfb2ba839a0e999 (diff)
parent33189462c6fd60496ae1afec093fb9803d23a18b (diff)
Merge "Allow VMs to access internet"
Diffstat (limited to 'ansible/roles/infra_check_requirements')
-rw-r--r--ansible/roles/infra_check_requirements/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/ansible/roles/infra_check_requirements/tasks/main.yml b/ansible/roles/infra_check_requirements/tasks/main.yml
index 8d05bbdb7..a11bc56a1 100644
--- a/ansible/roles/infra_check_requirements/tasks/main.yml
+++ b/ansible/roles/infra_check_requirements/tasks/main.yml
@@ -34,6 +34,22 @@
msg: "Failed, not enough CPU, required: {{ vcpu_t }}, available {{ ansible_processor_vcpus }}"
when: ansible_processor_vcpus < vcpu_t|int
+- name: Define default network counter
+ set_fact:
+ num_default_network_detected: 0
+
+- name: Increment counter for every default network detected
+ set_fact:
+ num_default_network_detected: "{{ num_default_network_detected|int + 1 }}"
+ when:
+ - item.default_gateway is defined
+ - item.default_gateway == True
+ with_items: "{{infra_deploy_vars.networks}}"
+
+- name: Fail if more than 1 or 0 default networks
+ fail:
+ msg: "Failed, there must be 1 default network: {{ num_default_network_detected }} detected"
+ when: num_default_network_detected|int != 1
- name: Fail if not enough Disk space
set_fact: