butler_ddochi/ansible_manager/models.py
icurfer ea11832a53
Some checks failed
Build And Test / build-and-push (push) Failing after 53s
init
2024-12-13 17:12:03 +09:00

23 lines
876 B
Python

from django.db import models
from django.conf import settings
class AnsibleJob(models.Model):
"""Ansible 작업 관리 모델"""
STATUS_CHOICES = [
('PENDING', 'Pending'),
('RUNNING', 'Running'),
('SUCCESS', 'Success'),
('FAILED', 'Failed'),
]
name = models.CharField(max_length=200)
playbook_content = models.TextField(help_text="Ansible Playbook YAML 내용")
inventory_content = models.TextField(help_text="Ansible Inventory 내용")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='PENDING')
result = models.TextField(blank=True, null=True)
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
def __str__(self):
return self.name