These instructions assume:
-
You have already cloned this repository locally:
git clone https://github.com/ucla-data-science-center/dataverse-ansible.git cd dataverse-ansible -
Docker is installed and running on your system.
To create a consistent development environment using pip-tools:
```bash
conda env create -f environment.yml
conda activate dataverse-ansible
```
This will install:
- Python 3.11
pip-tools(to manage Python packages via lockfiles)
This project uses pip-tools for dependency management. After activating the environment:
```bash
pip-compile requirements.in
pip-sync
```
This will install:
ansible-coremoleculemolecule-dockerdocker(Python SDK)
You only need to run
pip-compileagain ifrequirements.inchanges. Usepip-syncto reinstall the locked dependencies.
If you prefer not to use environment.yml or pip-tools, you can manually create and install dependencies:
```bash
conda create -n dataverse-ansible python=3.11 -y
conda activate dataverse-ansible
pip install ansible-core molecule molecule-docker docker
```
The rocky9 Molecule scenario uses Docker as a provisioner. It relies on a custom image with systemd support, allowing sudo commands to run inside the container. This avoids modifying the Ansible role's privilege escalation behavior.
From the root of the cloned repository, run:
```bash
molecule converge --scenario-name rocky9
```
This will build a Docker container, install Dataverse, and configure services.
Once complete, you should be able to access Dataverse at:
http://localhost:8080
Default admin login:
- Username:
dataverseAdmin - Password: defined in
tests/group_vars/vagrant.yml(seedataverse_adminpass)
To verify the server is responding:
```bash
curl -I http://localhost:8080
```
Because the Dataverse installer is not idempotent, it’s recommended to fully reset the container between changes.
To stop and delete the container:
```bash
molecule reset --scenario-name rocky9
```
Then rebuild with:
```bash
molecule converge --scenario-name rocky9
```
To open a shell inside the running container:
```bash
molecule login --scenario-name rocky9
```
To see additional Molecule commands:
```bash
molecule --help
```
More documentation: https://ansible.readthedocs.io/projects/molecule/
- If port
8080is already in use on your machine, update the port mapping inmolecule/rocky9/molecule.yml. - Ensure Docker Desktop (macOS) or the Docker daemon (Linux/WSL2) is running before launching
molecule converge.
If you're using WSL2 with Debian Linux, make the following adjustments (see branch: windows_wsl2_jmj):
-
In
minio.yml, lines 68 and 79:
Changecommunity.docker.docker_compose→community.docker.docker_compose_v2 -
In
tasks/postgres_redhat.yml, line 11:
Change-aarch64→{{ ansible_distribution_major_version }}-x86_64