Improved AI roles

This commit is contained in:
2025-06-02 22:52:04 +02:00
parent 54f7e5536a
commit 755e14a602
12 changed files with 144 additions and 73 deletions
+15
View File
@@ -0,0 +1,15 @@
- name: Setup pods fact
ansible.builtin.set_fact:
pods:
- name: "{{ item.name }}"
build:
dockerfile: "{{ lookup('template', 'Dockerfile.mcp.j2') }}"
ports:
- 0.0.0.0:{{ item.port | default(8000) }}:8000/tcp
env: "{{ item.env | default({}) }}"
volumes: "{{ item.volumes | default([]) }}"
- name: Setup Pods
ansible.builtin.include_tasks:
file: podman.yml
when: item.enabled | default(true)
+6 -5
View File
@@ -24,13 +24,13 @@
- acl
state: present
- name: Create group and user for AI workloads
- name: Create group and user for workloads
become: true
ansible.builtin.group:
name: "{{ podman_group }}"
system: true
- name: Create user and group for AI containers
- name: Create user and group for containers
become: true
ansible.builtin.user:
name: "{{ podman_user }}"
@@ -39,7 +39,7 @@
home: "{{ podman_user_home }}"
group: "{{ podman_group }}"
- name: Disable password login for AI user
- name: Disable password login for user
ansible.builtin.command: passwd -d "{{ podman_user }}"
become: true
changed_when: false
@@ -79,12 +79,12 @@
- name: Create folders
become: true
ansible.builtin.file:
path: "{{ podman_user_home }}/{{ item.name }}"
path: "{{ podman_user_home }}/{{ item }}"
state: directory
owner: "{{ podman_user }}"
group: "{{ podman_group }}"
mode: "0750"
loop: "{{ pods }}"
loop: "{{ podman_user_folders }}"
- name: Enable sudo access to podman user (temporary)
become: true
@@ -119,6 +119,7 @@
register: gid
- name: Ensure rootless Podman works with overlay driver on Debian-family systems
when: ansible_os_family == 'Debian'
become: true
vars:
subuid_range: "100000:65536"