Skip to content

Conversation

@edalquist
Copy link

This allows a user to override duplicity_pip_pip_executable and get the correct shebang environment setup

This allows a user to override duplicity_pip_pip_executable and get the correct shebang environment setup
path: "{{ duplicity_pip_duplicity_path }}"
regexp: '^\#\!\/usr\/bin\/env\ python3$'
replace: '#!/usr/bin/env python2'
when: ansible_distribution_version is version('20.04', '<')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this when statement because although 18.04 has python 3 duplicity is broken. We probably should do some more investigation. Or did you already do that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually using this role on Raspbian. The PPA repository for duplicity doesn't have arm binaries so I'm using the pip installer with pip3 explicitly named.

- name: "Install pip (rPi)"
  when: inventory_hostname in groups['rpi']
  become: true
  apt:
    update_cache: yes
    pkg:
      - python3-pip

- name: Install duplicity (pip)
  when: inventory_hostname in groups['rpi']
  include_role:
    name: oefenweb.duplicity
    apply:
      become: true
  vars:
    duplicity_install_method: pip
    duplicity_pip_pip_executable: pip3
    duplicity_pip_dependencies_python:
      - duplicity
      - paramiko

With this setup and the current logic the installed duplicity script fails to run as it was installed in using python3 but the fix shebang step essentially breaks things as it ends up trying to run it using python2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants