Check only role path for NetworkConfig

This also changes local_action syntax to use delegate_to
for uniformity.

Change-Id: Iad3626cee70b3a6f824e9c0d3f7ff0b3a25fd7c9
This commit is contained in:
Rabi Mishra 2020-09-18 08:47:56 +05:30
parent 7c8108cced
commit a61c57d22f
1 changed files with 3 additions and 7 deletions

View File

@ -538,14 +538,10 @@ outputs:
tasks:
{% raw %}
- name: Check NetworkConfig script existence
local_action:
module: stat
path: "{{ lookup('first_found', NetworkConfig_paths, errors='ignore') }}"
delegate_to: localhost
stat:
path: "{{ tripleo_role_name ~ '/NetworkConfig' }}"
register: NetworkConfig_stat
vars:
NetworkConfig_paths:
- "{{ tripleo_role_name ~ '/' ~ inventory_hostname ~ '/NetworkConfig' }}"
- "{{ tripleo_role_name ~ '/NetworkConfig' }}"
- name: Run Network Config
import_role:
name: tripleo_network_config