16 lines
542 B
Python
16 lines
542 B
Python
# ansible/models.py
|
|
|
|
from django.db import models
|
|
|
|
|
|
class AnsibleTask(models.Model):
|
|
name = models.CharField(max_length=200)
|
|
author_email = models.CharField(max_length=150)
|
|
playbook_content = models.TextField()
|
|
inventory_content = models.TextField()
|
|
status = models.CharField(max_length=50, default='pending') # pending, running, success, failed, error
|
|
output = models.TextField(blank=True)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.name} ({self.status})" |