add steam and ollama role to test

This commit is contained in:
Grégory Lebreton 2026-01-07 11:51:42 +01:00
parent 7ca1d18973
commit 6d2d39a4b0
5 changed files with 77 additions and 6 deletions

View File

@ -3,22 +3,23 @@
## Configuration ## Configuration
```bash ```bash
sudo apt install ansible
``` ```
## Utilisation ## Utilisation
- Install all: - Install all:
```bash ```bash
ansible-playbook playbooks/install.yml --ask-become-pass
``` ```
- Install only on role: - Install only one role:
```bash ```bash
ansible-playbook playbooks/install.yml --ask-become-pass --tags ollama
``` ```
## To do ## To do
- [ ] test go tasks - [ ] test wine
- [ ] test steam
- [ ] test ollama

View File

@ -0,0 +1,4 @@
---
ollama_install_script: https://ollama.com/install.sh
ollama_service_name: ollama
ollama_bin: /usr/local/bin/ollama

View File

@ -0,0 +1,5 @@
---
- name: Restart Ollama
ansible.builtin.systemd:
name: ollama
state: restarted

View File

@ -0,0 +1,35 @@
---
- name: Vérifier que le système est Linux
ansible.builtin.assert:
that:
- ansible_facts['kernel'] == "Linux"
fail_msg: "Ollama est uniquement supporté sur Linux"
- name: Vérifier si Ollama est déjà installé
ansible.builtin.stat:
path: "{{ ollama_bin }}"
register: ollama_bin_stat
- name: Installer curl (prérequis)
ansible.builtin.apt:
name: curl
state: present
update_cache: yes
- name: Télécharger le script dinstallation Ollama
ansible.builtin.get_url:
url: "{{ ollama_install_script }}"
dest: /tmp/ollama_install.sh
mode: '0755'
when: not ollama_bin_stat.stat.exists
- name: Installer Ollama
ansible.builtin.command: /tmp/ollama_install.sh
when: not ollama_bin_stat.stat.exists
notify: Restart Ollama
- name: Activer et démarrer le service Ollama
ansible.builtin.systemd:
name: "{{ ollama_service_name }}"
enabled: yes
state: started

View File

@ -0,0 +1,26 @@
---
- name: Vérifier que le système est Debian
ansible.builtin.assert:
that:
- ansible_facts['distribution'] == "Debian"
fail_msg: "Ce rôle est prévu uniquement pour Debian"
- name: Ajouter larchitecture i386
ansible.builtin.command: dpkg --add-architecture i386
register: add_i386
changed_when: add_i386.rc == 0
- name: Activer contrib et non-free
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian {{ ansible_facts['distribution_release'] }} main contrib non-free non-free-firmware"
state: present
filename: debian-contrib-nonfree
- name: Mettre à jour le cache APT
ansible.builtin.apt:
update_cache: yes
- name: Installer Steam
ansible.builtin.apt:
name: steam
state: present