mount_iso.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Initialize vars
  16. set_fact:
  17. mount_check: true
  18. tags: install
  19. - name: Create iso directory
  20. file:
  21. path: "/mnt/{{ iso_path }}"
  22. state: directory
  23. tags: install
  24. - name: Check mountpoint
  25. command: mountpoint /mnt/{{ iso_path }}
  26. changed_when: false
  27. register: result
  28. ignore_errors: yes
  29. tags: install
  30. - name: Update mount status
  31. set_fact:
  32. mount_check: "{{ result.failed }}"
  33. tags: install
  34. - name: Mount the iso file
  35. command: mount -o loop {{ path_for_iso_file }} /mnt/{{ iso_path }}
  36. changed_when: false
  37. args:
  38. warn: no
  39. when: mount_check == true
  40. tags: install