# Copyright 2021 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: Add nfs client entries hosts: localhost connection: local gather_facts: false tasks: - name: Include control_plane_repo vars include_vars: ../../control_plane_repo/vars/main.yml - name: Check if idrac inventory file exists stat: path: "../../collect_device_info/files/idrac_inventory" register: provisioned_file_result - name: Check {{ exports_file_path }} command: cat {{ exports_file_path }} register: exports_file_check changed_when: false when: provisioned_file_result.stat.exists - name: Adding NFS share entries in {{ exports_file_path }} lineinfile: path: "{{ exports_file_path }}" line: "{{ nfs_share_offline_repo }} {{ item }}(rw,sync,no_root_squash)" when: - provisioned_file_result.stat.exists - item not in exports_file_check.stdout loop: "{{ lookup('file', '../../collect_device_info/files/idrac_inventory').splitlines() }}" - name: Exporting the shared directories command: /usr/sbin/exportfs -r changed_when: true when: provisioned_file_result.stat.exists - name: Copy exports file to custom_iso role copy: src: "{{ exports_file_path }}" dest: "{{ playbook_dir }}/exports" mode: preserve when: provisioned_file_result.stat.exists