Quellcode durchsuchen

bugfix: use link to installer instead of installer
to trigger version changes even when installer_dir is extern

Thomas Verchow vor 7 Jahren
Ursprung
Commit
79bc8529ab
1 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen
  1. 13 8
      tasks/main.yml

+ 13 - 8
tasks/main.yml

@@ -18,19 +18,24 @@
       dest: "{{ anaconda_installer_file }}"
       force: False
       checksum: "md5:{{ anaconda_installer_md5 }}"
-    register: installer_file
-  - name: pre - write warning into Anaconda installer dir
+  - name: pre - link installer file to anaconda home
+    file:
+      src: "{{ anaconda_installer_file }}"
+      dest: "{{ anaconda_home_dir }}/installer.sh"
+      state: link
+    register: installer
+  - name: pre - write a note for installer
     copy:
-      dest: "{{ anaconda_installer_file }}.WARNING.txt"
+      dest: "{{ anaconda_home_dir }}/installer.README.txt"
       content: |
-        Do not touch the file because ansible
-        may use it to decide if a reinstallation 
+        Do not touch the linked file because ansible 
+        uses it to decide if a reinstallation 
         (uninstall/install) is necessary.
   - name: pre - remove installation for a new install
     # if the installer file changes, we assume a new version should be installed
     # (the Anaconda way recommend a 'conda update' or similar instead of a new
     # installation but we won't to that here to keep it simple stupid)
-    when: installer_file|changed
+    when: installer|changed
     file:
       dest: "{{ anaconda_install_dir }}"
       state: absent
@@ -42,11 +47,11 @@
 
 - name: install
 # =============
-  when: "anaconda_state == 'present' and (installer_file|changed or anaconda_force_install)"
+  when: "anaconda_state == 'present' and (installer|changed or anaconda_force_install)"
 
   block:
   - name: install - run installer
-    command: "bash {{ anaconda_installer_file }} -b -p {{ anaconda_install_dir }} {{ anaconda_force_install|ternary('-f', '') }}"
+    command: "bash {{ anaconda_home_dir }}/installer.sh -b -p {{ anaconda_install_dir }} {{ anaconda_force_install|ternary('-f', '') }}"
     failed_when: false
     register: installer_out
   - name: install - fail if installer finished unsuccessfully