2016-12-19 2 views
0

ich einen symbolischen Link von der Quelle zum Ziel zu setzen versuchen, hält aberSymlink Fehler einrichten - ansible

tödlich treffen: [Standard]: failed! => {"geändert": false, "failed": true, "msg": "Fehler beim Linken: [Errno 2] Keine solche Datei oder Verzeichnis", "path": "/Applications/Xcode.app/Contents/Developer /Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/config.h "," state „:‚abwesend‘}

beobachtet, dass es zeigt, Zustand abwesend obwohl Zustand als Link angegeben.

Dies wird die Aufgabe ausgeführt:

- name: "Create ruby config.h symlink" 
    file: 
    src: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15/ruby/config.h" 
    dest: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/config.h" 
    state: link 
    force: yes 
    when: xcode_version != "8.0" 

Datei existiert:

ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15/ruby/config.h 
-rw-r--r-- 2 root wheel 7805 Jan 31 2016 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15/ruby/config.h 

Hinweis: Inklusive Kraft ja hier auf Diskussion basiert - Ansbible github issue

Jede Hilfe ist willkommen!

+0

Können Sie Entfernen Sie 'force' und versuchen Sie es? – helloV

+0

zunächst ohne Kraftaufwand versucht, gleicher Fehler in beiden Fällen. –

Antwort

0

Ich bin mir nicht sicher, ob ein fehlendes Verzeichnis die Ursache für das Problem ist hier, aber es ist eine gute Übung, um sicherzustellen, dass das Zielverzeichnis vorhanden ist, bevor Sie einen Link erstellen, die auf das Verzeichnis verweist:

- name: Ensure that the directory exist 
    file: 
    path: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby" 
    state: directory 
    mode: 0755 
    owner: root 
    group: wheel 

- name: "Create ruby config.h symlink" 
    file: 
    ...