---
+# Where to download ISOs
+iso_dir: /var/lib/cobbler/isos
+# Mount point to use for ISOs during import
+iso_mount: /mnt/iso
+
kickstarts:
- cephlab_trusty.preseed
- cephlab_rhel.ks
---
- name: Update distro signatures
command: cobbler signature update
+
+- name: Create ISO directory
+ file:
+ path: "{{ iso_dir }}"
+ state: directory
+
+- name: Create ISO mountpoint
+ file:
+ path: "{{ iso_mount }}"
+ state: directory
---
-# Where to download ISOs
-iso_dir: /var/lib/cobbler/isos
-# Mount point to use for ISOs during import
-iso_mount: /mnt/iso
-
distros:
# Distros with empty iso values will be skipped. These dicts will be
# updated with same-named items in an 'extra_distros' var, which can be
---
-- name: Create ISO directory
- file:
- path: "{{ iso_dir }}"
- state: directory
-
-- name: Create ISO mountpoint
- file:
- path: "{{ iso_mount }}"
- state: directory
-
- name: Set ISO name
set_fact:
iso_name: "{{ distro.iso.split('/')[-1] }}"
set_fact:
iso_path: "{{ iso_dir }}/{{ iso_name }}"
+- name: Check to see if the ISO exists
+ stat: path={{ iso_path }} get_checksum=no get_md5=no
+ register: iso_stat
+
- name: Download ISO
get_url:
url={{ distro.iso }}
- name: Mount ISO
command: mount -o loop {{ iso_path }} {{ iso_mount }}
- when: download|changed
+ when: download|changed or (iso_stat.stat.exists and
+ profile is defined and profile.stdout == '')
register: mount
- name: Set arch