butler_ddochi/ansible_manager/models.py
icurfer fd3ab674c3
All checks were successful
Build And Test / build-and-push (push) Successful in 4m16s
ansible edit 수정
2025-04-09 13:06:10 +09:00

23 lines
900 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(blank=True, null=True) # Ansible Playbook YAML 내용
inventory_content = models.TextField(blank=True, null=True) # 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