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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: vm_tool
3
- Version: 1.0.19
3
+ Version: 1.0.20
4
4
  Summary: A Comprehensive Tool for Setting Up Virtual Machines.
5
5
  Home-page: https://github.com/thesunnysinha/vm_tool
6
6
  Author: Sunny Sinha
@@ -11,7 +11,7 @@ else:
11
11
 
12
12
  setup(
13
13
  name='vm_tool',
14
- version='1.0.19', # This will be updated by bump2version
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.19')
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, HttpUrl, validator
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: HttpUrl
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
- # Check if the dynamic inventory file already exists
78
- if os.path.exists(inventory_file_path):
79
- # Read the existing inventory file
80
- with open(inventory_file_path, 'r') as inventory_file:
81
- inventory_content = yaml.safe_load(inventory_file)
82
- else:
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
- for i, ssh_config in enumerate(ssh_configs):
94
- host_key = f'cloud_host_{i}'
95
- inventory_content['all']['hosts'][host_key] = {
96
- 'ansible_host': ssh_config.ssh_hostname,
97
- 'ansible_user': ssh_config.ssh_username,
98
- 'ansible_ssh_pass': ssh_config.ssh_password
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
- # Write dynamic inventory to a file
102
- with open(inventory_file_path, 'w') as inventory_file:
103
- yaml.dump(inventory_content, inventory_file)
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 = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: vm_tool
3
- Version: 1.0.19
3
+ Version: 1.0.20
4
4
  Summary: A Comprehensive Tool for Setting Up Virtual Machines.
5
5
  Home-page: https://github.com/thesunnysinha/vm_tool
6
6
  Author: Sunny Sinha
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes