Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
abolfazl8131 authored Nov 27, 2024
2 parents 1b5c315 + d182782 commit 7b8f6f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/ansible_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


class AnsibleInstallNginx(BaseModel):

os: str = 'ubuntu'
hosts:List[str] = ['www.example.com']
version:str = 'latest'
Expand Down
6 changes: 6 additions & 0 deletions app/routes/ansible.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from app.app_instance import app
from app.gpt_services import gpt_service
from app.services import (write_installation,edit_directory_generator,execute_pythonfile)

from app.models import (AnsibleInstallNginx,AnsibleInstallDocker,Output)

from app.models import (AnsibleInstallNginx,Output)

from app.template_generators.ansible.install.main import ansible_install_template
import os

Expand All @@ -11,6 +15,7 @@ async def ansible_install_generation_nginx(request:AnsibleInstallNginx) -> Outpu
if os.environ.get("TEST"):
return Output(output='output')
generated_prompt = ansible_install_template(request,"nginx")

output = gpt_service(generated_prompt)
edit_directory_generator("ansible_generator",output)
execute_pythonfile("MyAnsible","ansible_generator")
Expand All @@ -23,6 +28,7 @@ async def ansible_install_generation_docker(request:AnsibleInstallDocker) -> Out
if os.environ.get("TEST"):
return Output(output='output')
generated_prompt = ansible_install_template(request,"docker")

output = gpt_service(generated_prompt)
edit_directory_generator("ansible_generator",output)
execute_pythonfile("MyAnsible","ansible_generator")
Expand Down

0 comments on commit 7b8f6f2

Please sign in to comment.