|
@@ -0,0 +1,40 @@
|
|
|
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
|
|
|
+#
|
|
|
+# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
+# you may not use this file except in compliance with the License.
|
|
|
+# You may obtain a copy of the License at
|
|
|
+#
|
|
|
+# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
+#
|
|
|
+# Unless required by applicable law or agreed to in writing, software
|
|
|
+# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
+# See the License for the specific language governing permissions and
|
|
|
+# limitations under the License.
|
|
|
+---
|
|
|
+
|
|
|
+- name: Check IP
|
|
|
+ set_fact:
|
|
|
+ device_ip: "{{ lookup('file', '{{ device_ip_list_path }}').splitlines() |list }}"
|
|
|
+
|
|
|
+- name: Filter all the IP present
|
|
|
+ set_fact:
|
|
|
+ len1: "{{ device_ip | length }}"
|
|
|
+ device_ip_temp: "{{ device_ip | ipv4('address') | list }}"
|
|
|
+
|
|
|
+- name: size
|
|
|
+ set_fact:
|
|
|
+ len2: "{{ device_ip_temp | length }}"
|
|
|
+
|
|
|
+- name: Assert if valid device_ip_file
|
|
|
+ assert:
|
|
|
+ that:
|
|
|
+ - len1 == len2
|
|
|
+ fail_msg: "{{ fail_device_ip_format }}"
|
|
|
+ success_msg: "{{ success_device_ip_format }}"
|
|
|
+
|
|
|
+- name: Copy the Ips to file
|
|
|
+ copy:
|
|
|
+ src: "{{ device_ip_list_path }}"
|
|
|
+ dest: "{{ mgmnt_ip_path }}"
|
|
|
+ mode: "{{ file_perm }}"
|