Search code examples
ansibleconfigansible-inventoryconan

Destination /home/developer/.conan/conan.conf does not exist


I am building ansible-core project, but due to following code snipped getting error

# This was necessary to prevent errors when upgading conan from an earlier to a newer version, as the accepted file format changed.
- name: Make conan storage path absolute
  lineinfile:
    path: '{{ HOME }}/.conan/conan.conf'
    regexp: '^path ='
    line: path = ./data

Error-

TASK [Make conan storage path absolute] ****************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Destination /home/developer/.conan/conan.conf does not exist !", "rc": 257}

I tried commenting that part and was able to build but not sure whether to remove that code snippet


Solution

  • I have resolved issue by changing path from '{{ HOME }}' to '~'

    # This was necessary to prevent errors when upgading conan from an earlier to a 
    newer version, as the accepted file format changed.
    
    - name: Make conan storage path absolute
      lineinfile:
        path: '{{ HOME }}/.conan/conan.conf'
        regexp: '^path ='
        line: path = ./data