Ansible role to install Wine on UNIX-like platforms. Wine (originally an acronym for "Wine Is Not an Emulator") is a compatibility layer capable of running Windows applications on several UNIX-like operating systems.
This role requires:
- Ansible
- Python
- Administrative/root access on target hosts
- One of the following operating systems:
- Alpine Linux
- Debian/Ubuntu
- NixOS or systems with Nix package manager
To install this role from Ansible Galaxy, run the following command:
ansible-galaxy install ea31337.wineTo install this role from GitHub, run:
ansible-galaxy install git+https://github.com/EA31337/ansible-role-wine.gitAvailable variables are listed below, along with default values (see defaults/main.yml):
# Wine package release to install (stable, devel, or staging)
wine_release: stable
# Override Ubuntu/Debian release codename for Wine repository
# Use this to install older Wine versions from previous release repos
# Example: 'jammy' for Ubuntu 22.04 to get Wine 10.x on newer Ubuntu
wine_release_codename: ""
# Specific Wine package version to install (optional)
# For Ubuntu/Debian: can be either simple (10.0) or full (10.0.0.0~jammy-1)
# For Alpine: package version format (e.g., 10.0)
# For NixOS: version suffix (e.g., 10.0)
wine_version: ""
# Whether to install recommended packages
wine_install_recommends: false
# Whether to install winetricks
wine_install_winetricks: false
# Whether to initialize ~/.wine (disabled by default)
wine_init: falseTo install Wine 10.0 on Ubuntu Noble (24.04) using the jammy repository:
- hosts: all
roles:
- role: ea31337.wine
vars:
wine_release: stable
wine_release_codename: jammy
wine_version: "10.0" # Automatically expands to 10.0.0.0~jammy-1Or if you want to specify the exact version:
- hosts: all
roles:
- role: ea31337.wine
vars:
wine_release: stable
wine_release_codename: jammy
wine_version: "10.0.0.0~jammy-1" # Full version stringSteps to test role on Docker containers.
-
Install the current role by running the following commands in shell:
ansible-galaxy install -r requirements.yml jinja2 requirements-local.yml.j2 -D "pwd=$PWD" -o requirements-local.yml ansible-galaxy install -r requirements-local.ymlAlternatively, for development purposes, you can use a symbolic link, e.g.
mkdir -p ~/.ansible/roles ln -vs "$PWD" ~/.ansible/roles/ea31337.wine
-
Ensure Docker service (e.g. Docker Desktop) is running.
-
Run playbook from
tests/:ansible-playbook -i tests/inventory/docker-containers.yml tests/playbooks/docker-containers.yml
To test using Molecule, run:
molecule testThe Docker image is automatically built and pushed to the GitHub Container Registry (GHCR) on every merge to master
and on new tags.
To pull the latest image:
docker pull ghcr.io/ea31337/ansible-role-wine:latestThe following tags are available for different platforms:
| Platform | Latest Tag | Branch Tag | Version Tag Example |
|---|---|---|---|
| Ubuntu Latest (Default) | latest |
master |
v1.0.0 |
| Ubuntu Noble (24.04) | ubuntu-noble |
latest-ubuntu-noble |
v1.0.0-ubuntu-noble |
| Ubuntu Jammy (22.04) | ubuntu-jammy |
latest-ubuntu-jammy |
v1.0.0-ubuntu-jammy |
| Debian Latest | debian-latest |
latest-debian-latest |
v1.0.0-debian-latest |
| Alpine Latest | alpine-latest |
latest-alpine-latest |
v1.0.0-alpine-latest |
| NixOS Latest | nixos-latest |
latest-nixos-latest |
v1.0.0-nixos-latest |
For a specific branch (e.g., develop), use the branch name as the tag: ghcr.io/ea31337/ansible-role-wine:develop-<platform>.
GNU GPL v3
See: LICENSE