vm-tool 1.0.19__tar.gz → 1.0.20__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-1.0.19/vm_tool.egg-info → vm_tool-1.0.20}/PKG-INFO +1 -1
- {vm_tool-1.0.19 → vm_tool-1.0.20}/setup.py +1 -1
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/cli.py +1 -1
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/runner.py +21 -25
- {vm_tool-1.0.19 → vm_tool-1.0.20/vm_tool.egg-info}/PKG-INFO +1 -1
- {vm_tool-1.0.19 → vm_tool-1.0.20}/LICENSE +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/MANIFEST.in +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/README.md +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/setup.cfg +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/__init__.py +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/ssh.py +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/vm_setup/docker/create_docker_service.yml +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/vm_setup/docker/install_docker_and_compose.yml +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/vm_setup/dynamic_inventory.yml +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/vm_setup/inventory.yml +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool/vm_setup/setup.yml +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool.egg-info/SOURCES.txt +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool.egg-info/dependency_links.txt +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool.egg-info/entry_points.txt +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool.egg-info/requires.txt +0 -0
- {vm_tool-1.0.19 → vm_tool-1.0.20}/vm_tool.egg-info/top_level.txt +0 -0
|
@@ -11,7 +11,7 @@ else:
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name='vm_tool',
|
|
14
|
-
version='1.0.
|
|
14
|
+
version='1.0.20', # This will be updated by bump2version
|
|
15
15
|
packages=find_packages(),
|
|
16
16
|
description='A Comprehensive Tool for Setting Up Virtual Machines.',
|
|
17
17
|
long_description=long_description,
|
|
@@ -2,7 +2,7 @@ import argparse
|
|
|
2
2
|
|
|
3
3
|
def main():
|
|
4
4
|
parser = argparse.ArgumentParser(description='Setup VMs using Ansible.')
|
|
5
|
-
parser.add_argument('--version', action='version', version='1.0.
|
|
5
|
+
parser.add_argument('--version', action='version', version='1.0.20')
|
|
6
6
|
|
|
7
7
|
args = parser.parse_args()
|
|
8
8
|
|
|
@@ -2,13 +2,13 @@ import sys
|
|
|
2
2
|
import ansible_runner
|
|
3
3
|
import os
|
|
4
4
|
import yaml
|
|
5
|
-
from pydantic import BaseModel,
|
|
5
|
+
from pydantic import BaseModel, validator
|
|
6
6
|
from typing import List
|
|
7
7
|
|
|
8
8
|
class SetupRunnerConfig(BaseModel):
|
|
9
9
|
github_username: str
|
|
10
10
|
github_token: str
|
|
11
|
-
github_project_url:
|
|
11
|
+
github_project_url: str
|
|
12
12
|
docker_compose_file_path: str = 'docker-compose.yml'
|
|
13
13
|
|
|
14
14
|
@validator('docker_compose_file_path', pre=True, always=True)
|
|
@@ -74,33 +74,29 @@ class SetupRunner:
|
|
|
74
74
|
# Define the path for the dynamic inventory file
|
|
75
75
|
inventory_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'vm_setup', 'dynamic_inventory.yml')
|
|
76
76
|
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# Create dynamic inventory content
|
|
84
|
-
inventory_content = {
|
|
85
|
-
'all': {
|
|
86
|
-
'hosts': {},
|
|
87
|
-
'vars': {
|
|
88
|
-
'ansible_python_interpreter': '/usr/bin/python3'
|
|
89
|
-
}
|
|
77
|
+
# Create dynamic inventory content
|
|
78
|
+
inventory_content = {
|
|
79
|
+
'all': {
|
|
80
|
+
'hosts': {},
|
|
81
|
+
'vars': {
|
|
82
|
+
'ansible_python_interpreter': '/usr/bin/python3'
|
|
90
83
|
}
|
|
91
84
|
}
|
|
85
|
+
}
|
|
92
86
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
print(ssh_configs)
|
|
88
|
+
|
|
89
|
+
for i, ssh_config in enumerate(ssh_configs):
|
|
90
|
+
host_key = f'cloud_host_{i}'
|
|
91
|
+
inventory_content['all']['hosts'][host_key] = {
|
|
92
|
+
'ansible_host': ssh_config.ssh_hostname,
|
|
93
|
+
'ansible_user': ssh_config.ssh_username,
|
|
94
|
+
'ansible_ssh_pass': ssh_config.ssh_password
|
|
95
|
+
}
|
|
100
96
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
# Write dynamic inventory to a file
|
|
98
|
+
with open(inventory_file_path, 'w') as inventory_file:
|
|
99
|
+
yaml.dump(inventory_content, inventory_file)
|
|
104
100
|
|
|
105
101
|
# Construct extravars dictionary
|
|
106
102
|
extravars = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|