]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Move ISO dir/mountpoint creation to cobbler role 29/head
authorZack Cerza <zack@redhat.com>
Thu, 14 May 2015 19:08:11 +0000 (13:08 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 14 May 2015 19:08:11 +0000 (13:08 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
roles/cobbler/defaults/main.yml
roles/cobbler/tasks/distro_prep.yml
roles/cobbler_profile/defaults/main.yml
roles/cobbler_profile/tasks/download_iso.yml
roles/cobbler_profile/tasks/import_distro.yml

index b095e402963e8b6035b94d554b13b797f7afbf85..7710df9f8c1e3a1210d3128fbe2ca650ee0f2f96 100644 (file)
@@ -1,4 +1,9 @@
 ---
+# 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
index 8c6ba7b84c0b0ba08e4b3c26d9808a1ce24d20b3..27e7d252356da1637b678c7dfeae551f43466cda 100644 (file)
@@ -1,3 +1,13 @@
 ---
 - 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
index e8022cf8944ce6108d44856ed8b9c5c9a31f28b9..f37e62d7a2d629a61c21cbe1cb067f8385b60310 100644 (file)
@@ -1,9 +1,4 @@
 ---
-# 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 
index e2f4b271cf9e78acbc1fabdd1d6674d24808bd26..c6b65fc69b9435eb44601b16c0510d974e171417 100644 (file)
@@ -1,14 +1,4 @@
 ---
-- 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] }}"
@@ -17,6 +7,10 @@
   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 }}
index 7d33c4ad19bb449297198553de3fb21395866247..6ab3cbd02bdbef4bfd16c49290632c29e44fcfc9 100644 (file)
@@ -33,7 +33,8 @@
 
 - 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