add steam and ollama role to test
This commit is contained in:
parent
7ca1d18973
commit
6d2d39a4b0
13
README.md
13
README.md
@ -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
|
||||||
|
|||||||
4
roles/ollama/defaults/main.yml
Normal file
4
roles/ollama/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
ollama_install_script: https://ollama.com/install.sh
|
||||||
|
ollama_service_name: ollama
|
||||||
|
ollama_bin: /usr/local/bin/ollama
|
||||||
5
roles/ollama/handlers/main.yml
Normal file
5
roles/ollama/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: Restart Ollama
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: ollama
|
||||||
|
state: restarted
|
||||||
35
roles/ollama/tasks/main.yml
Normal file
35
roles/ollama/tasks/main.yml
Normal 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 d’installation 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
|
||||||
26
roles/steam/tasks/main.yml
Normal file
26
roles/steam/tasks/main.yml
Normal 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 l’architecture 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
|
||||||
Loading…
x
Reference in New Issue
Block a user