Skip to content

Commit

Permalink
🚧 Initial version with pipx
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Oct 13, 2024
1 parent d8277f7 commit 8e14456
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python-version: "3.x"

- name: Install test dependencies
run: pip3 install ansible yamllint==1.35.1 ansible-lint==24.2.0
run: pipx install ansible yamllint==1.35.1 ansible-lint==24.2.0

- name: Ansible-lint
run: ansible-lint nas.yml
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributing to Ansible-NAS is easy! Add your functionality, then raise a pull r
## Development Environment

* Development of Ansible-NAS is carried out in [JetBrains PyCharm](https://www.jetbrains.com/?from=Ansible-NAS) on Linux - you'll get some nice recommended extensions and task setups if you do the same.
* You'll need a working Python 3 environment, Docker (to run tests) and [pre-commit](https://pre-commit.com) installed - `pip install -r requirements-dev.txt`.
* You'll need a working Python 3 environment, Docker (to run tests) and [pre-commit](https://pre-commit.com) installed - `pipx install -r requirements-dev.txt`.

## General Stuff

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Read the [migrating from FreeNAS](https://ansible-nas.io/docs/further-configurat

## Requirements

* Ansible NAS targets the latest Ubuntu LTS release, which is currently Ubuntu Server 22.04 LTS.
* Ansible NAS targets the latest Ubuntu LTS release, which is currently Ubuntu Server 24.04 LTS.
* You can run Ansible-NAS on whatever hardware you like, read the docs for more info. I use an HP Microserver.

## Getting Help
Expand Down
12 changes: 5 additions & 7 deletions roles/ansible-nas-docker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
---
- name: Install python3-pip
- name: Install pipx
ansible.builtin.apt:
name: python3-pip
name: pipx
state: present
register: result
until: result is succeeded

- name: Remove docker-py python module
ansible.builtin.pip:
community.general.pipx:
name: docker-py
state: absent
break_system_packages: true
register: result
until: result is succeeded

- name: Install docker python module
ansible.builtin.pip:
community.general.pipx:
name: docker
state: present
break_system_packages: true
state: install_all
register: result
until: result is succeeded

Expand Down
9 changes: 5 additions & 4 deletions roles/booksonic/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2

- name: Create a dummy booksonic onfig directory
ansible.builtin.file:
Expand Down
9 changes: 5 additions & 4 deletions roles/drone-ci/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2

- name: Create a dummy gitea config directory
ansible.builtin.file:
Expand Down
11 changes: 6 additions & 5 deletions roles/livehelperchat/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
- molecule-plugins[docker]
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2
- molecule-plugins[docker]
- name: Install unzip
ansible.builtin.apt:
name: unzip
Expand Down
9 changes: 5 additions & 4 deletions roles/openldap/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2

- name: Update repositories cache and install "gnupg" package
ansible.builtin.apt:
Expand Down
11 changes: 6 additions & 5 deletions roles/restic/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
hosts: localhost
tasks:
- name: Install jmespath
ansible.builtin.pip:
community.general.pipx:
name: jmespath

- name: Prepare instance
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2
9 changes: 5 additions & 4 deletions roles/woodpecker-ci/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2

- name: Create a dummy gitea config directory
ansible.builtin.file:
Expand Down
11 changes: 6 additions & 5 deletions tests/molecule/resources/playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name:
- docker
- urllib3<2
- molecule-plugins[docker]
community.general.pipx:
name: "{{ item }}"
with_items:
- docker
- urllib3<2
- molecule-plugins[docker]
2 changes: 1 addition & 1 deletion website/docs/contributing/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Developing Ansible-NAS features require a few things:
## Setup

- Ansible requirements - `ansible-galaxy install -r requirements.yml`
- Python requirements - `pip install -r requirements-dev.txt`
- Python requirements - `pipx install -r requirements-dev.txt`
- Node.js requirements - `pushd website && npm install && popd`

## IDE
Expand Down
4 changes: 2 additions & 2 deletions website/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Ansible-NAS is an Ansible playbook that sets up applications of your choice on y

## Requirements

- A Linux environment with Ansible installed (in Ansible terms the "control node"). See the official [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) docs for more info.
- SSH access to an Ubuntu 22.04 server that'll become your Ansible-NAS box. It's recommended to use a fresh Ubuntu Server 22.04 installation. Do not use non-LTS releases. Do not install Docker during the Ubuntu installation.
- A Linux environment with Ansible installed (in Ansible terms the "control node"). See the official [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) docs for more info. Use `pipx` install method to avoid problems with virtual environments on Ubuntu 24+.
- SSH access to an Ubuntu 24.04 server that'll become your Ansible-NAS box. It's recommended to use a fresh Ubuntu Server 24.04 installation. Do not use non-LTS releases. Do not install Docker during the Ubuntu installation.

:::tip

Expand Down

0 comments on commit 8e14456

Please sign in to comment.