From ebf4afdad031e81bc2ec74cb583b33a1ea258427 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Fri, 21 Sep 2018 12:36:00 +0800 Subject: [PATCH] Move the ironic-check action into prechecks.yml Change-Id: Ia1fa141acd7233f0c9dd30dd3d13e31cf1a2fb8e --- ansible/roles/neutron/tasks/deploy.yml | 2 -- ansible/roles/neutron/tasks/ironic-check.yml | 5 ----- ansible/roles/neutron/tasks/precheck.yml | 8 ++++++++ 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 ansible/roles/neutron/tasks/ironic-check.yml diff --git a/ansible/roles/neutron/tasks/deploy.yml b/ansible/roles/neutron/tasks/deploy.yml index 959e584888..af50675de4 100644 --- a/ansible/roles/neutron/tasks/deploy.yml +++ b/ansible/roles/neutron/tasks/deploy.yml @@ -1,6 +1,4 @@ --- -- include_tasks: ironic-check.yml - - include_tasks: register.yml when: inventory_hostname in groups['neutron-server'] diff --git a/ansible/roles/neutron/tasks/ironic-check.yml b/ansible/roles/neutron/tasks/ironic-check.yml deleted file mode 100644 index f22bf70b87..0000000000 --- a/ansible/roles/neutron/tasks/ironic-check.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- fail: msg="Ironic must be enabled when using networking-baremetal/ironic-neutron-agent" - when: - - enable_ironic_neutron_agent | bool - - not (enable_ironic | bool) diff --git a/ansible/roles/neutron/tasks/precheck.yml b/ansible/roles/neutron/tasks/precheck.yml index b234949476..774f8af07a 100644 --- a/ansible/roles/neutron/tasks/precheck.yml +++ b/ansible/roles/neutron/tasks/precheck.yml @@ -57,3 +57,11 @@ when: - (groups['inner-compute'] | default([]) | length > 0 or groups['external-compute'] | default([]) | length > 0) + +- name: Checking whether Ironic enabled + local_action: fail msg="Ironic must be enabled when using networking-baremetal/ironic-neutron-agent" + changed_when: false + run_once: True + when: + - enable_ironic_neutron_agent | bool + - not (enable_ironic | bool)