vm-tool 0.5__tar.gz → 0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vm_tool-0.5/vm_tool.egg-info → vm_tool-0.7}/PKG-INFO +1 -1
- {vm_tool-0.5 → vm_tool-0.7}/setup.py +1 -1
- vm_tool-0.7/vm_tool/__init__.py +0 -0
- vm_tool-0.7/vm_tool/runner.py +36 -0
- {vm_tool-0.5 → vm_tool-0.7/vm_tool.egg-info}/PKG-INFO +1 -1
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool.egg-info/SOURCES.txt +1 -0
- vm_tool-0.5/vm_tool/__init__.py +0 -1
- {vm_tool-0.5 → vm_tool-0.7}/LICENSE +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/README.md +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/setup.cfg +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool/cli.py +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool.egg-info/dependency_links.txt +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool.egg-info/entry_points.txt +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool.egg-info/requires.txt +0 -0
- {vm_tool-0.5 → vm_tool-0.7}/vm_tool.egg-info/top_level.txt +0 -0
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ansible_runner
|
|
2
|
+
|
|
3
|
+
class SetupRunner:
|
|
4
|
+
def __init__(self, ssh_host, ssh_user, ssh_password, become_pass, github_username, github_token, github_project_url):
|
|
5
|
+
self.ssh_host = ssh_host
|
|
6
|
+
self.ssh_user = ssh_user
|
|
7
|
+
self.ssh_password = ssh_password
|
|
8
|
+
self.become_pass = become_pass
|
|
9
|
+
self.github_username = github_username
|
|
10
|
+
self.github_token = github_token
|
|
11
|
+
self.github_project_url = github_project_url
|
|
12
|
+
|
|
13
|
+
def run_setup(self):
|
|
14
|
+
# Construct extravars dictionary
|
|
15
|
+
extravars = {
|
|
16
|
+
'ANSIBLE_SSH_HOST': self.ssh_host,
|
|
17
|
+
'ANSIBLE_SSH_USER': self.ssh_user,
|
|
18
|
+
'ANSIBLE_SSH_PASS': self.ssh_password,
|
|
19
|
+
'ANSIBLE_BECOME_PASS': self.become_pass,
|
|
20
|
+
'GITHUB_USERNAME': self.github_username,
|
|
21
|
+
'GITHUB_TOKEN': self.github_token,
|
|
22
|
+
'GITHUB_PROJECT_URL': self.github_project_url
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Run the Ansible playbook using ansible-runner
|
|
26
|
+
r = ansible_runner.run(
|
|
27
|
+
private_data_dir='.',
|
|
28
|
+
playbook='vm_tool/vm_setup/setup.yml',
|
|
29
|
+
inventory='vm_tool/vm_setup/inventory.yml',
|
|
30
|
+
extravars=extravars
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
if r.rc != 0:
|
|
34
|
+
raise RuntimeError(f"Ansible playbook execution failed: {r.stdout}")
|
|
35
|
+
|
|
36
|
+
print(r.stdout)
|
vm_tool-0.5/vm_tool/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .src.setup_runner import SetupRunner
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|