diff --git a/Makefile b/Makefile index ea236d4c..c215cb15 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ install-requirements: ## Install system dependencies @echo "—————————————————————————————— SYSTEM REQUIREMENTS ———————————————————————————" @sudo apt-get install -y \ python3 python3-dev python3-venv python3-pip direnv bash bash-completion \ - lsb-release unzip curl sshpass skopeo + lsb-release unzip curl sshpass skopeo librsync-dev @grep -q 'eval "$$(direnv hook bash)"' ~/.bashrc || \ echo 'eval "$$(direnv hook bash)"' >> ~/.bashrc diff --git a/roles/stage1_pip/defaults/main.yml b/roles/stage1_pip/defaults/main.yml index 5a1205d2..af1a62c7 100644 --- a/roles/stage1_pip/defaults/main.yml +++ b/roles/stage1_pip/defaults/main.yml @@ -12,3 +12,6 @@ packages_list: - cryptography - dnspython - passlib + - duplicity + +pip_root_folder_external: '/usr/lib/python3.11/EXTERNALLY-MANAGED' diff --git a/roles/stage1_pip/tasks/debian_11/_install.yml b/roles/stage1_pip/tasks/debian/_install.yml similarity index 60% rename from roles/stage1_pip/tasks/debian_11/_install.yml rename to roles/stage1_pip/tasks/debian/_install.yml index 9a366aa0..356906c0 100644 --- a/roles/stage1_pip/tasks/debian_11/_install.yml +++ b/roles/stage1_pip/tasks/debian/_install.yml @@ -1,4 +1,9 @@ --- +- name: 'Ensure not exists {{ pip_root_folder_external }}' + file: + path: '{{ pip_root_folder_external }}' + state: absent + - name: Install Python packages # noqa: command-instead-of-module command-instead-of-shell shell: > pip install --no-index --find-links=/var/cache/pip/ {{ packages_list | join(' ') }} diff --git a/roles/stage1_pip/tasks/debian/_prepare.yml b/roles/stage1_pip/tasks/debian/_prepare.yml new file mode 100644 index 00000000..3ba2c79a --- /dev/null +++ b/roles/stage1_pip/tasks/debian/_prepare.yml @@ -0,0 +1,17 @@ +--- +- name: Download dependencies for duplicity pip packages # noqa: command-instead-of-module + command: > + apt-get install -y --download-only librsync-dev + tags: + - online + +- name: Install dependencies for duplicity + ansible.builtin.apt: + name: librsync-dev + state: present + +- name: Download python packages # noqa: command-instead-of-module + shell: > + pip wheel --wheel-dir /var/cache/pip {{ packages_list | join(' ') }} + tags: + - online diff --git a/roles/stage1_pip/tasks/debian_11/main.yml b/roles/stage1_pip/tasks/debian/main.yml similarity index 100% rename from roles/stage1_pip/tasks/debian_11/main.yml rename to roles/stage1_pip/tasks/debian/main.yml diff --git a/roles/stage1_pip/tasks/debian_11/_prepare.yml b/roles/stage1_pip/tasks/debian_11/_prepare.yml deleted file mode 100644 index 4bdfc852..00000000 --- a/roles/stage1_pip/tasks/debian_11/_prepare.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Download python packages # noqa: command-instead-of-module - shell: > - pip wheel --wheel-dir /var/cache/pip {{ packages_list | join(' ') }} - tags: - - online