1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- # 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: Validate cobbler configuration status
- set_fact:
- cobbler_config_status: false
- profile_exists: false
- when: cobbler_config_status
- - name: Check prifile for {{ provision_os }} exists
- set_fact:
- profile_exists: true
- when: provision_os in cobbler_profile_list.stdout
- - name: Create a temp iso directory to mount the iso files
- file:
- path: "/mnt/tmp"
- state: directory
- mode: "{{ temp_file_perm }}"
- when: not profile_exists
- - name: Check {{ provision_os }} folder status
- stat:
- path: "/mnt/{{ provision_os }}"
- register: file_status
- - name: Create directory for {{ provision_os }} to copy the iso files
- file:
- path: "/mnt/{{ provision_os }}"
- state: directory
- mode: "{{ temp_file_perm }}"
- when:
- - not file_status.stat.exists
- - not profile_exists
- - name: Mount the iso file
- command: mount -o loop {{ iso_file_path }} /mnt/tmp
- args:
- warn: no
- when: not profile_exists
- - name: Copy the iso file inside /mnt
- command: rsync -AHPSXav /mnt/tmp/ /mnt/{{ provision_os }}/
- changed_when: false
- failed_when: false
- args:
- warn: false
- when: not profile_exists
- - name: Unmount /mnt/tmp for further mounts
- command: umount /mnt/tmp
- when: not profile_exists
- - name: Provision password validation
- import_tasks: provision_password.yml
- - name: Cobbler configuration
- import_tasks: configure_cobbler.yml
|