1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- ---
- - 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: cp -rf /mnt/tmp/. /mnt/{{ provision_os }}
- changed_when: 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
|