vm-tool 1.0.28__tar.gz → 1.0.29__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.29/PKG-INFO +169 -0
- vm_tool-1.0.29/README.md +119 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/setup.py +1 -1
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/cli.py +1 -1
- vm_tool-1.0.29/vm_tool.egg-info/PKG-INFO +169 -0
- vm_tool-1.0.28/PKG-INFO +0 -234
- vm_tool-1.0.28/README.md +0 -184
- vm_tool-1.0.28/vm_tool.egg-info/PKG-INFO +0 -234
- {vm_tool-1.0.28 → vm_tool-1.0.29}/LICENSE +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/MANIFEST.in +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/setup.cfg +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/__init__.py +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/runner.py +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/ssh.py +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/cleanup.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/docker/create_docker_service.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/docker/docker_setup.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/docker/install_docker_and_compose.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/docker/login_to_docker_hub.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/dynamic_inventory.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/github/git_configuration.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/inventory.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/main.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/project_service.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool/vm_setup/setup.yml +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool.egg-info/SOURCES.txt +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool.egg-info/dependency_links.txt +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool.egg-info/entry_points.txt +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool.egg-info/requires.txt +0 -0
- {vm_tool-1.0.28 → vm_tool-1.0.29}/vm_tool.egg-info/top_level.txt +0 -0
vm_tool-1.0.29/PKG-INFO
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vm_tool
|
|
3
|
+
Version: 1.0.29
|
|
4
|
+
Summary: A Comprehensive Tool for Setting Up Virtual Machines.
|
|
5
|
+
Home-page: https://github.com/thesunnysinha/vm_tool
|
|
6
|
+
Author: Sunny Sinha
|
|
7
|
+
Author-email: thesunnysinha@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://github.com/thesunnysinha/vm_tool/README.md
|
|
10
|
+
Project-URL: Source, https://github.com/thesunnysinha/vm_tool
|
|
11
|
+
Project-URL: Tracker, https://github.com/thesunnysinha/vm_tool/issues
|
|
12
|
+
Keywords: virtual machine setup ansible automation
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Requires-Python: >=3.6
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: ansible
|
|
28
|
+
Requires-Dist: ansible-runner
|
|
29
|
+
Requires-Dist: paramiko
|
|
30
|
+
Requires-Dist: pydantic
|
|
31
|
+
Requires-Dist: pyyaml
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8; extra == "dev"
|
|
35
|
+
Requires-Dist: bump2version; extra == "dev"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: author-email
|
|
38
|
+
Dynamic: classifier
|
|
39
|
+
Dynamic: description
|
|
40
|
+
Dynamic: description-content-type
|
|
41
|
+
Dynamic: home-page
|
|
42
|
+
Dynamic: keywords
|
|
43
|
+
Dynamic: license
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: project-url
|
|
46
|
+
Dynamic: provides-extra
|
|
47
|
+
Dynamic: requires-dist
|
|
48
|
+
Dynamic: requires-python
|
|
49
|
+
Dynamic: summary
|
|
50
|
+
|
|
51
|
+
# 🚀 VM Setup Tool
|
|
52
|
+
|
|
53
|
+
[](https://pypi.org/project/vm-tool/) [](https://pypi.org/project/vm-tool/)
|
|
54
|
+
|
|
55
|
+
[**PyPI**](https://pypi.org/project/vm-tool/) • [**GitHub**](https://github.com/thesunnysinha/vm_tool) • [**Contributing**](CONTRIBUTING) • [**License**](LICENSE)
|
|
56
|
+
|
|
57
|
+
A modern, user-friendly solution for automating and managing virtual machine (VM) setup and configuration using Ansible.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ✨ Features
|
|
62
|
+
- Automated VM setup with Docker & Docker Compose
|
|
63
|
+
- Cloud VM provisioning via SSH
|
|
64
|
+
- SSH key management and configuration
|
|
65
|
+
- Simple Python API for integration
|
|
66
|
+
- One-command version check: `vm_tool --version`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## ⚡️ Installation
|
|
71
|
+
Install the latest version from PyPI:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install vm-tool
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🛠️ Usage Examples
|
|
80
|
+
|
|
81
|
+
### Automated Local VM Setup
|
|
82
|
+
```python
|
|
83
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
84
|
+
|
|
85
|
+
config = SetupRunnerConfig(
|
|
86
|
+
github_username='your_github_username',
|
|
87
|
+
github_token='your_github_token',
|
|
88
|
+
github_project_url='your_github_project_url',
|
|
89
|
+
github_branch='your_branch_name',
|
|
90
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
91
|
+
dockerhub_username='your_dockerhub_username',
|
|
92
|
+
dockerhub_password='your_dockerhub_password'
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
runner = SetupRunner(config)
|
|
96
|
+
runner.run_setup()
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Cloud VM Setup (via SSH)
|
|
100
|
+
```python
|
|
101
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
102
|
+
|
|
103
|
+
config = SetupRunnerConfig(
|
|
104
|
+
github_username='your_github_username',
|
|
105
|
+
github_token='your_github_token',
|
|
106
|
+
github_project_url='your_github_project_url',
|
|
107
|
+
github_branch='your_branch_name',
|
|
108
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
109
|
+
dockerhub_username='your_dockerhub_username',
|
|
110
|
+
dockerhub_password='your_dockerhub_password'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
runner = SetupRunner(config)
|
|
114
|
+
|
|
115
|
+
ssh_configs = [
|
|
116
|
+
SSHConfig(
|
|
117
|
+
ssh_username='your_ssh_username',
|
|
118
|
+
ssh_password='your_ssh_password',
|
|
119
|
+
ssh_hostname='your_ssh_hostname',
|
|
120
|
+
ssh_identity_file='/path/to/your/ssh_key' # Optional
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
runner.run_cloud_setup(ssh_configs)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### SSH Key Management
|
|
128
|
+
```python
|
|
129
|
+
from vm_tool.ssh import SSHSetup
|
|
130
|
+
|
|
131
|
+
ssh_setup = SSHSetup(
|
|
132
|
+
hostname='your_vm_hostname',
|
|
133
|
+
username='your_vm_username',
|
|
134
|
+
password='your_vm_password',
|
|
135
|
+
email='your_email_for_ssh_key'
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
ssh_setup.setup()
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🖥️ Command Line Version Check
|
|
144
|
+
|
|
145
|
+
Check your installed version at any time:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
vm_tool --version
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## ⚙️ Configuration Options
|
|
154
|
+
- `github_username`: GitHub username (for private repos)
|
|
155
|
+
- `github_token`: GitHub token (for private repos)
|
|
156
|
+
- `github_project_url`: GitHub repository URL
|
|
157
|
+
- `github_branch`: Branch to use (default: main)
|
|
158
|
+
- `docker_compose_file_path`: Path to Docker Compose file (default: docker-compose.yml)
|
|
159
|
+
- `dockerhub_username`: Docker Hub username (if login needed)
|
|
160
|
+
- `dockerhub_password`: Docker Hub password (if login needed)
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 📚 Learn More
|
|
165
|
+
See the [PyPI page](https://pypi.org/project/vm-tool/) for more details, or visit the [GitHub repository](https://github.com/thesunnysinha/vm_tool) for full documentation, issues, and contributions.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
Empower your infrastructure automation with **VM Setup Tool** – fast, reliable, and developer-friendly!
|
vm_tool-1.0.29/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# 🚀 VM Setup Tool
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/vm-tool/) [](https://pypi.org/project/vm-tool/)
|
|
4
|
+
|
|
5
|
+
[**PyPI**](https://pypi.org/project/vm-tool/) • [**GitHub**](https://github.com/thesunnysinha/vm_tool) • [**Contributing**](CONTRIBUTING) • [**License**](LICENSE)
|
|
6
|
+
|
|
7
|
+
A modern, user-friendly solution for automating and managing virtual machine (VM) setup and configuration using Ansible.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
12
|
+
- Automated VM setup with Docker & Docker Compose
|
|
13
|
+
- Cloud VM provisioning via SSH
|
|
14
|
+
- SSH key management and configuration
|
|
15
|
+
- Simple Python API for integration
|
|
16
|
+
- One-command version check: `vm_tool --version`
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ⚡️ Installation
|
|
21
|
+
Install the latest version from PyPI:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install vm-tool
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🛠️ Usage Examples
|
|
30
|
+
|
|
31
|
+
### Automated Local VM Setup
|
|
32
|
+
```python
|
|
33
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
34
|
+
|
|
35
|
+
config = SetupRunnerConfig(
|
|
36
|
+
github_username='your_github_username',
|
|
37
|
+
github_token='your_github_token',
|
|
38
|
+
github_project_url='your_github_project_url',
|
|
39
|
+
github_branch='your_branch_name',
|
|
40
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
41
|
+
dockerhub_username='your_dockerhub_username',
|
|
42
|
+
dockerhub_password='your_dockerhub_password'
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
runner = SetupRunner(config)
|
|
46
|
+
runner.run_setup()
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Cloud VM Setup (via SSH)
|
|
50
|
+
```python
|
|
51
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
52
|
+
|
|
53
|
+
config = SetupRunnerConfig(
|
|
54
|
+
github_username='your_github_username',
|
|
55
|
+
github_token='your_github_token',
|
|
56
|
+
github_project_url='your_github_project_url',
|
|
57
|
+
github_branch='your_branch_name',
|
|
58
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
59
|
+
dockerhub_username='your_dockerhub_username',
|
|
60
|
+
dockerhub_password='your_dockerhub_password'
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
runner = SetupRunner(config)
|
|
64
|
+
|
|
65
|
+
ssh_configs = [
|
|
66
|
+
SSHConfig(
|
|
67
|
+
ssh_username='your_ssh_username',
|
|
68
|
+
ssh_password='your_ssh_password',
|
|
69
|
+
ssh_hostname='your_ssh_hostname',
|
|
70
|
+
ssh_identity_file='/path/to/your/ssh_key' # Optional
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
runner.run_cloud_setup(ssh_configs)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### SSH Key Management
|
|
78
|
+
```python
|
|
79
|
+
from vm_tool.ssh import SSHSetup
|
|
80
|
+
|
|
81
|
+
ssh_setup = SSHSetup(
|
|
82
|
+
hostname='your_vm_hostname',
|
|
83
|
+
username='your_vm_username',
|
|
84
|
+
password='your_vm_password',
|
|
85
|
+
email='your_email_for_ssh_key'
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
ssh_setup.setup()
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🖥️ Command Line Version Check
|
|
94
|
+
|
|
95
|
+
Check your installed version at any time:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
vm_tool --version
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## ⚙️ Configuration Options
|
|
104
|
+
- `github_username`: GitHub username (for private repos)
|
|
105
|
+
- `github_token`: GitHub token (for private repos)
|
|
106
|
+
- `github_project_url`: GitHub repository URL
|
|
107
|
+
- `github_branch`: Branch to use (default: main)
|
|
108
|
+
- `docker_compose_file_path`: Path to Docker Compose file (default: docker-compose.yml)
|
|
109
|
+
- `dockerhub_username`: Docker Hub username (if login needed)
|
|
110
|
+
- `dockerhub_password`: Docker Hub password (if login needed)
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 📚 Learn More
|
|
115
|
+
See the [PyPI page](https://pypi.org/project/vm-tool/) for more details, or visit the [GitHub repository](https://github.com/thesunnysinha/vm_tool) for full documentation, issues, and contributions.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
Empower your infrastructure automation with **VM Setup Tool** – fast, reliable, and developer-friendly!
|
|
@@ -11,7 +11,7 @@ else:
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name='vm_tool',
|
|
14
|
-
version='1.0.
|
|
14
|
+
version='1.0.29', # 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='VM Tool version info')
|
|
5
|
-
parser.add_argument('--version', action='version', version='1.0.
|
|
5
|
+
parser.add_argument('--version', action='version', version='1.0.29')
|
|
6
6
|
parser.parse_args()
|
|
7
7
|
|
|
8
8
|
if __name__ == '__main__':
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vm_tool
|
|
3
|
+
Version: 1.0.29
|
|
4
|
+
Summary: A Comprehensive Tool for Setting Up Virtual Machines.
|
|
5
|
+
Home-page: https://github.com/thesunnysinha/vm_tool
|
|
6
|
+
Author: Sunny Sinha
|
|
7
|
+
Author-email: thesunnysinha@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://github.com/thesunnysinha/vm_tool/README.md
|
|
10
|
+
Project-URL: Source, https://github.com/thesunnysinha/vm_tool
|
|
11
|
+
Project-URL: Tracker, https://github.com/thesunnysinha/vm_tool/issues
|
|
12
|
+
Keywords: virtual machine setup ansible automation
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Requires-Python: >=3.6
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: ansible
|
|
28
|
+
Requires-Dist: ansible-runner
|
|
29
|
+
Requires-Dist: paramiko
|
|
30
|
+
Requires-Dist: pydantic
|
|
31
|
+
Requires-Dist: pyyaml
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8; extra == "dev"
|
|
35
|
+
Requires-Dist: bump2version; extra == "dev"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: author-email
|
|
38
|
+
Dynamic: classifier
|
|
39
|
+
Dynamic: description
|
|
40
|
+
Dynamic: description-content-type
|
|
41
|
+
Dynamic: home-page
|
|
42
|
+
Dynamic: keywords
|
|
43
|
+
Dynamic: license
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: project-url
|
|
46
|
+
Dynamic: provides-extra
|
|
47
|
+
Dynamic: requires-dist
|
|
48
|
+
Dynamic: requires-python
|
|
49
|
+
Dynamic: summary
|
|
50
|
+
|
|
51
|
+
# 🚀 VM Setup Tool
|
|
52
|
+
|
|
53
|
+
[](https://pypi.org/project/vm-tool/) [](https://pypi.org/project/vm-tool/)
|
|
54
|
+
|
|
55
|
+
[**PyPI**](https://pypi.org/project/vm-tool/) • [**GitHub**](https://github.com/thesunnysinha/vm_tool) • [**Contributing**](CONTRIBUTING) • [**License**](LICENSE)
|
|
56
|
+
|
|
57
|
+
A modern, user-friendly solution for automating and managing virtual machine (VM) setup and configuration using Ansible.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ✨ Features
|
|
62
|
+
- Automated VM setup with Docker & Docker Compose
|
|
63
|
+
- Cloud VM provisioning via SSH
|
|
64
|
+
- SSH key management and configuration
|
|
65
|
+
- Simple Python API for integration
|
|
66
|
+
- One-command version check: `vm_tool --version`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## ⚡️ Installation
|
|
71
|
+
Install the latest version from PyPI:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install vm-tool
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🛠️ Usage Examples
|
|
80
|
+
|
|
81
|
+
### Automated Local VM Setup
|
|
82
|
+
```python
|
|
83
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
84
|
+
|
|
85
|
+
config = SetupRunnerConfig(
|
|
86
|
+
github_username='your_github_username',
|
|
87
|
+
github_token='your_github_token',
|
|
88
|
+
github_project_url='your_github_project_url',
|
|
89
|
+
github_branch='your_branch_name',
|
|
90
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
91
|
+
dockerhub_username='your_dockerhub_username',
|
|
92
|
+
dockerhub_password='your_dockerhub_password'
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
runner = SetupRunner(config)
|
|
96
|
+
runner.run_setup()
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Cloud VM Setup (via SSH)
|
|
100
|
+
```python
|
|
101
|
+
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
102
|
+
|
|
103
|
+
config = SetupRunnerConfig(
|
|
104
|
+
github_username='your_github_username',
|
|
105
|
+
github_token='your_github_token',
|
|
106
|
+
github_project_url='your_github_project_url',
|
|
107
|
+
github_branch='your_branch_name',
|
|
108
|
+
docker_compose_file_path='path_to_your_docker_compose_file',
|
|
109
|
+
dockerhub_username='your_dockerhub_username',
|
|
110
|
+
dockerhub_password='your_dockerhub_password'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
runner = SetupRunner(config)
|
|
114
|
+
|
|
115
|
+
ssh_configs = [
|
|
116
|
+
SSHConfig(
|
|
117
|
+
ssh_username='your_ssh_username',
|
|
118
|
+
ssh_password='your_ssh_password',
|
|
119
|
+
ssh_hostname='your_ssh_hostname',
|
|
120
|
+
ssh_identity_file='/path/to/your/ssh_key' # Optional
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
runner.run_cloud_setup(ssh_configs)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### SSH Key Management
|
|
128
|
+
```python
|
|
129
|
+
from vm_tool.ssh import SSHSetup
|
|
130
|
+
|
|
131
|
+
ssh_setup = SSHSetup(
|
|
132
|
+
hostname='your_vm_hostname',
|
|
133
|
+
username='your_vm_username',
|
|
134
|
+
password='your_vm_password',
|
|
135
|
+
email='your_email_for_ssh_key'
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
ssh_setup.setup()
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🖥️ Command Line Version Check
|
|
144
|
+
|
|
145
|
+
Check your installed version at any time:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
vm_tool --version
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## ⚙️ Configuration Options
|
|
154
|
+
- `github_username`: GitHub username (for private repos)
|
|
155
|
+
- `github_token`: GitHub token (for private repos)
|
|
156
|
+
- `github_project_url`: GitHub repository URL
|
|
157
|
+
- `github_branch`: Branch to use (default: main)
|
|
158
|
+
- `docker_compose_file_path`: Path to Docker Compose file (default: docker-compose.yml)
|
|
159
|
+
- `dockerhub_username`: Docker Hub username (if login needed)
|
|
160
|
+
- `dockerhub_password`: Docker Hub password (if login needed)
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 📚 Learn More
|
|
165
|
+
See the [PyPI page](https://pypi.org/project/vm-tool/) for more details, or visit the [GitHub repository](https://github.com/thesunnysinha/vm_tool) for full documentation, issues, and contributions.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
Empower your infrastructure automation with **VM Setup Tool** – fast, reliable, and developer-friendly!
|
vm_tool-1.0.28/PKG-INFO
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: vm_tool
|
|
3
|
-
Version: 1.0.28
|
|
4
|
-
Summary: A Comprehensive Tool for Setting Up Virtual Machines.
|
|
5
|
-
Home-page: https://github.com/thesunnysinha/vm_tool
|
|
6
|
-
Author: Sunny Sinha
|
|
7
|
-
Author-email: thesunnysinha@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://github.com/thesunnysinha/vm_tool/README.md
|
|
10
|
-
Project-URL: Source, https://github.com/thesunnysinha/vm_tool
|
|
11
|
-
Project-URL: Tracker, https://github.com/thesunnysinha/vm_tool/issues
|
|
12
|
-
Keywords: virtual machine setup ansible automation
|
|
13
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Intended Audience :: System Administrators
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Programming Language :: Python
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
23
|
-
Classifier: Topic :: System :: Systems Administration
|
|
24
|
-
Requires-Python: >=3.6
|
|
25
|
-
Description-Content-Type: text/markdown
|
|
26
|
-
License-File: LICENSE
|
|
27
|
-
Requires-Dist: ansible
|
|
28
|
-
Requires-Dist: ansible-runner
|
|
29
|
-
Requires-Dist: paramiko
|
|
30
|
-
Requires-Dist: pydantic
|
|
31
|
-
Requires-Dist: pyyaml
|
|
32
|
-
Provides-Extra: dev
|
|
33
|
-
Requires-Dist: pytest; extra == "dev"
|
|
34
|
-
Requires-Dist: flake8; extra == "dev"
|
|
35
|
-
Requires-Dist: bump2version; extra == "dev"
|
|
36
|
-
Dynamic: author
|
|
37
|
-
Dynamic: author-email
|
|
38
|
-
Dynamic: classifier
|
|
39
|
-
Dynamic: description
|
|
40
|
-
Dynamic: description-content-type
|
|
41
|
-
Dynamic: home-page
|
|
42
|
-
Dynamic: keywords
|
|
43
|
-
Dynamic: license
|
|
44
|
-
Dynamic: license-file
|
|
45
|
-
Dynamic: project-url
|
|
46
|
-
Dynamic: provides-extra
|
|
47
|
-
Dynamic: requires-dist
|
|
48
|
-
Dynamic: requires-python
|
|
49
|
-
Dynamic: summary
|
|
50
|
-
|
|
51
|
-
# **VM Setup Tool**
|
|
52
|
-
### **A Comprehensive Solution for Streamlining Virtual Machine Configuration**
|
|
53
|
-
|
|
54
|
-
## **Overview**
|
|
55
|
-
The **VM Setup Tool** is an efficient, user-friendly solution designed to simplify the process of setting up and managing virtual machines (VMs) using Ansible. Ideal for automating VM deployment and configuration, this tool ensures consistency and enhances operational efficiency across your infrastructure.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## **Pre-requisites**
|
|
60
|
-
This tool supports projects utilizing **Docker Compose**.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## **Installation**
|
|
65
|
-
Install the VM Setup Tool using **pip**, the Python package manager:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pip install vm-tool
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## **Example Usage**
|
|
74
|
-
|
|
75
|
-
### **Automated VM Setup**
|
|
76
|
-
Use the following example to configure and run the VM setup:
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
80
|
-
|
|
81
|
-
config = SetupRunnerConfig(
|
|
82
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
83
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
84
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
85
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
86
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
87
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
88
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
runner = SetupRunner(config)
|
|
92
|
-
|
|
93
|
-
runner.run_setup()
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### **What Happens During Setup**
|
|
97
|
-
The VM Setup Tool will:
|
|
98
|
-
1. Configure Git with GitHub token if provided.
|
|
99
|
-
2. Clone the specified GitHub repository to your local machine.
|
|
100
|
-
3. Install **Docker** if it’s not already available on the target machine.
|
|
101
|
-
4. Install **Docker Compose** for managing multi-container applications.
|
|
102
|
-
5. Log in to Docker Hub if credentials are provided.
|
|
103
|
-
6. Create, enable, and start the Docker service.
|
|
104
|
-
7. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
105
|
-
|
|
106
|
-
By automating these tasks, the tool minimizes errors and saves time, allowing you to focus on development and deployment.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## **Cloud Setup**
|
|
111
|
-
The **VM Setup Tool** also supports cloud setup for VMs. Use the following example to configure and run the cloud setup:
|
|
112
|
-
|
|
113
|
-
```python
|
|
114
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
115
|
-
|
|
116
|
-
config = SetupRunnerConfig(
|
|
117
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
118
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
119
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
120
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
121
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
122
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
123
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
runner = SetupRunner(config)
|
|
127
|
-
|
|
128
|
-
ssh_configs = [
|
|
129
|
-
SSHConfig(
|
|
130
|
-
ssh_username='your_ssh_username_1', # e.g., ssh_user_1
|
|
131
|
-
ssh_password='your_ssh_password_1', # Optional, only use if you don’t want to use SSH key
|
|
132
|
-
ssh_hostname='your_ssh_hostname_1', # e.g., ssh1.example.com
|
|
133
|
-
ssh_identity_file='/path/to/your/ssh_key_1' # Optional, path to SSH Identity file
|
|
134
|
-
),
|
|
135
|
-
SSHConfig(
|
|
136
|
-
ssh_username='your_ssh_username_2', # e.g., ssh_user_2
|
|
137
|
-
ssh_password='your_ssh_password_2', # Optional, only use if you don’t want to use SSH key
|
|
138
|
-
ssh_hostname='your_ssh_hostname_2', # e.g., ssh2.example.com
|
|
139
|
-
ssh_identity_file='/path/to/your/ssh_key_2' # Optional, path to SSH Identity file
|
|
140
|
-
)
|
|
141
|
-
# Add more SSHConfig instances as needed
|
|
142
|
-
]
|
|
143
|
-
|
|
144
|
-
runner.run_cloud_setup(ssh_configs)
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### **What Happens During Cloud Setup**
|
|
148
|
-
When you run the cloud setup, the tool will:
|
|
149
|
-
1. Connect to the specified cloud VM using SSH.
|
|
150
|
-
2. Configure Git with GitHub token if provided.
|
|
151
|
-
3. Clone the specified GitHub repository to the VM.
|
|
152
|
-
4. Install **Docker** if it’s not already available on the VM.
|
|
153
|
-
5. Install **Docker Compose** for managing multi-container applications.
|
|
154
|
-
6. Log in to Docker Hub if credentials are provided.
|
|
155
|
-
7. Create, enable, and start the Docker service on the VM.
|
|
156
|
-
8. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## **SSH Client Feature**
|
|
161
|
-
The **VM Setup Tool** also includes a dedicated **SSH client** feature to simplify the configuration of SSH access for VMs, including automated SSH key generation and management.
|
|
162
|
-
|
|
163
|
-
### **Example Usage**
|
|
164
|
-
|
|
165
|
-
```python
|
|
166
|
-
from vm_tool.ssh import SSHSetup
|
|
167
|
-
|
|
168
|
-
ssh_setup = SSHSetup(
|
|
169
|
-
hostname='your_vm_hostname', # e.g., vm.example.com
|
|
170
|
-
username='your_vm_username', # e.g., user
|
|
171
|
-
password='your_vm_password', # e.g., password
|
|
172
|
-
email='your_email_for_ssh_key' # e.g., user@example.com
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
ssh_setup.setup()
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### **What Happens During SSH Setup**
|
|
179
|
-
When you run the SSH setup, the tool will:
|
|
180
|
-
1. Generate an SSH key pair if none exists.
|
|
181
|
-
2. Read the public SSH key or create a new one if necessary.
|
|
182
|
-
3. Configure the VM by adding the public key to the VM's **authorized_keys** file.
|
|
183
|
-
4. Update the local SSH configuration file with the VM's details.
|
|
184
|
-
5. Establish an SSH connection to verify the setup.
|
|
185
|
-
6. Close the connection once setup is complete.
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Command Line Version Info
|
|
190
|
-
|
|
191
|
-
If you want to check the installed version of `vm_tool`, you can use the following command:
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
vm_tool --version
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
This will print the current version of the package.
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Python API Usage
|
|
202
|
-
|
|
203
|
-
The primary class for using the VM Setup Tool is `SetupRunner`, which orchestrates the entire setup process.
|
|
204
|
-
|
|
205
|
-
### **Example Usage**
|
|
206
|
-
|
|
207
|
-
```python
|
|
208
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
209
|
-
|
|
210
|
-
config = SetupRunnerConfig(
|
|
211
|
-
# Configuration options
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
runner = SetupRunner(config)
|
|
215
|
-
|
|
216
|
-
runner.run_setup()
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### **Configuration Options**
|
|
220
|
-
- `github_username`: Your GitHub username (required for private repositories).
|
|
221
|
-
- `github_token`: A GitHub token with repo access (required for private repositories).
|
|
222
|
-
- `github_project_url`: The URL of your GitHub project.
|
|
223
|
-
- `github_branch`: The branch of the GitHub repository to use.
|
|
224
|
-
- `docker_compose_file_path`: Path to your Docker Compose file.
|
|
225
|
-
- `dockerhub_username`: Your Docker Hub username (if Docker Hub login is needed).
|
|
226
|
-
- `dockerhub_password`: Your Docker Hub password (if Docker Hub login is needed).
|
|
227
|
-
|
|
228
|
-
### **Methods**
|
|
229
|
-
- `run_setup()`: Executes the VM setup process.
|
|
230
|
-
- `run_cloud_setup(ssh_configs)`: Executes the cloud VM setup process using the provided SSH configurations.
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
With its comprehensive features, the **VM Setup Tool** eliminates the hassle of manual configurations and enables seamless integration of VMs into your workflows. Start using the tool today to automate and optimize your virtual machine setup process.
|
vm_tool-1.0.28/README.md
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
# **VM Setup Tool**
|
|
2
|
-
### **A Comprehensive Solution for Streamlining Virtual Machine Configuration**
|
|
3
|
-
|
|
4
|
-
## **Overview**
|
|
5
|
-
The **VM Setup Tool** is an efficient, user-friendly solution designed to simplify the process of setting up and managing virtual machines (VMs) using Ansible. Ideal for automating VM deployment and configuration, this tool ensures consistency and enhances operational efficiency across your infrastructure.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## **Pre-requisites**
|
|
10
|
-
This tool supports projects utilizing **Docker Compose**.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## **Installation**
|
|
15
|
-
Install the VM Setup Tool using **pip**, the Python package manager:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pip install vm-tool
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## **Example Usage**
|
|
24
|
-
|
|
25
|
-
### **Automated VM Setup**
|
|
26
|
-
Use the following example to configure and run the VM setup:
|
|
27
|
-
|
|
28
|
-
```python
|
|
29
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
30
|
-
|
|
31
|
-
config = SetupRunnerConfig(
|
|
32
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
33
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
34
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
35
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
36
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
37
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
38
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
runner = SetupRunner(config)
|
|
42
|
-
|
|
43
|
-
runner.run_setup()
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### **What Happens During Setup**
|
|
47
|
-
The VM Setup Tool will:
|
|
48
|
-
1. Configure Git with GitHub token if provided.
|
|
49
|
-
2. Clone the specified GitHub repository to your local machine.
|
|
50
|
-
3. Install **Docker** if it’s not already available on the target machine.
|
|
51
|
-
4. Install **Docker Compose** for managing multi-container applications.
|
|
52
|
-
5. Log in to Docker Hub if credentials are provided.
|
|
53
|
-
6. Create, enable, and start the Docker service.
|
|
54
|
-
7. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
55
|
-
|
|
56
|
-
By automating these tasks, the tool minimizes errors and saves time, allowing you to focus on development and deployment.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## **Cloud Setup**
|
|
61
|
-
The **VM Setup Tool** also supports cloud setup for VMs. Use the following example to configure and run the cloud setup:
|
|
62
|
-
|
|
63
|
-
```python
|
|
64
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
65
|
-
|
|
66
|
-
config = SetupRunnerConfig(
|
|
67
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
68
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
69
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
70
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
71
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
72
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
73
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
runner = SetupRunner(config)
|
|
77
|
-
|
|
78
|
-
ssh_configs = [
|
|
79
|
-
SSHConfig(
|
|
80
|
-
ssh_username='your_ssh_username_1', # e.g., ssh_user_1
|
|
81
|
-
ssh_password='your_ssh_password_1', # Optional, only use if you don’t want to use SSH key
|
|
82
|
-
ssh_hostname='your_ssh_hostname_1', # e.g., ssh1.example.com
|
|
83
|
-
ssh_identity_file='/path/to/your/ssh_key_1' # Optional, path to SSH Identity file
|
|
84
|
-
),
|
|
85
|
-
SSHConfig(
|
|
86
|
-
ssh_username='your_ssh_username_2', # e.g., ssh_user_2
|
|
87
|
-
ssh_password='your_ssh_password_2', # Optional, only use if you don’t want to use SSH key
|
|
88
|
-
ssh_hostname='your_ssh_hostname_2', # e.g., ssh2.example.com
|
|
89
|
-
ssh_identity_file='/path/to/your/ssh_key_2' # Optional, path to SSH Identity file
|
|
90
|
-
)
|
|
91
|
-
# Add more SSHConfig instances as needed
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
runner.run_cloud_setup(ssh_configs)
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### **What Happens During Cloud Setup**
|
|
98
|
-
When you run the cloud setup, the tool will:
|
|
99
|
-
1. Connect to the specified cloud VM using SSH.
|
|
100
|
-
2. Configure Git with GitHub token if provided.
|
|
101
|
-
3. Clone the specified GitHub repository to the VM.
|
|
102
|
-
4. Install **Docker** if it’s not already available on the VM.
|
|
103
|
-
5. Install **Docker Compose** for managing multi-container applications.
|
|
104
|
-
6. Log in to Docker Hub if credentials are provided.
|
|
105
|
-
7. Create, enable, and start the Docker service on the VM.
|
|
106
|
-
8. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## **SSH Client Feature**
|
|
111
|
-
The **VM Setup Tool** also includes a dedicated **SSH client** feature to simplify the configuration of SSH access for VMs, including automated SSH key generation and management.
|
|
112
|
-
|
|
113
|
-
### **Example Usage**
|
|
114
|
-
|
|
115
|
-
```python
|
|
116
|
-
from vm_tool.ssh import SSHSetup
|
|
117
|
-
|
|
118
|
-
ssh_setup = SSHSetup(
|
|
119
|
-
hostname='your_vm_hostname', # e.g., vm.example.com
|
|
120
|
-
username='your_vm_username', # e.g., user
|
|
121
|
-
password='your_vm_password', # e.g., password
|
|
122
|
-
email='your_email_for_ssh_key' # e.g., user@example.com
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
ssh_setup.setup()
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### **What Happens During SSH Setup**
|
|
129
|
-
When you run the SSH setup, the tool will:
|
|
130
|
-
1. Generate an SSH key pair if none exists.
|
|
131
|
-
2. Read the public SSH key or create a new one if necessary.
|
|
132
|
-
3. Configure the VM by adding the public key to the VM's **authorized_keys** file.
|
|
133
|
-
4. Update the local SSH configuration file with the VM's details.
|
|
134
|
-
5. Establish an SSH connection to verify the setup.
|
|
135
|
-
6. Close the connection once setup is complete.
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Command Line Version Info
|
|
140
|
-
|
|
141
|
-
If you want to check the installed version of `vm_tool`, you can use the following command:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
vm_tool --version
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
This will print the current version of the package.
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Python API Usage
|
|
152
|
-
|
|
153
|
-
The primary class for using the VM Setup Tool is `SetupRunner`, which orchestrates the entire setup process.
|
|
154
|
-
|
|
155
|
-
### **Example Usage**
|
|
156
|
-
|
|
157
|
-
```python
|
|
158
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
159
|
-
|
|
160
|
-
config = SetupRunnerConfig(
|
|
161
|
-
# Configuration options
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
runner = SetupRunner(config)
|
|
165
|
-
|
|
166
|
-
runner.run_setup()
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### **Configuration Options**
|
|
170
|
-
- `github_username`: Your GitHub username (required for private repositories).
|
|
171
|
-
- `github_token`: A GitHub token with repo access (required for private repositories).
|
|
172
|
-
- `github_project_url`: The URL of your GitHub project.
|
|
173
|
-
- `github_branch`: The branch of the GitHub repository to use.
|
|
174
|
-
- `docker_compose_file_path`: Path to your Docker Compose file.
|
|
175
|
-
- `dockerhub_username`: Your Docker Hub username (if Docker Hub login is needed).
|
|
176
|
-
- `dockerhub_password`: Your Docker Hub password (if Docker Hub login is needed).
|
|
177
|
-
|
|
178
|
-
### **Methods**
|
|
179
|
-
- `run_setup()`: Executes the VM setup process.
|
|
180
|
-
- `run_cloud_setup(ssh_configs)`: Executes the cloud VM setup process using the provided SSH configurations.
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
With its comprehensive features, the **VM Setup Tool** eliminates the hassle of manual configurations and enables seamless integration of VMs into your workflows. Start using the tool today to automate and optimize your virtual machine setup process.
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: vm_tool
|
|
3
|
-
Version: 1.0.28
|
|
4
|
-
Summary: A Comprehensive Tool for Setting Up Virtual Machines.
|
|
5
|
-
Home-page: https://github.com/thesunnysinha/vm_tool
|
|
6
|
-
Author: Sunny Sinha
|
|
7
|
-
Author-email: thesunnysinha@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://github.com/thesunnysinha/vm_tool/README.md
|
|
10
|
-
Project-URL: Source, https://github.com/thesunnysinha/vm_tool
|
|
11
|
-
Project-URL: Tracker, https://github.com/thesunnysinha/vm_tool/issues
|
|
12
|
-
Keywords: virtual machine setup ansible automation
|
|
13
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Intended Audience :: System Administrators
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Programming Language :: Python
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
23
|
-
Classifier: Topic :: System :: Systems Administration
|
|
24
|
-
Requires-Python: >=3.6
|
|
25
|
-
Description-Content-Type: text/markdown
|
|
26
|
-
License-File: LICENSE
|
|
27
|
-
Requires-Dist: ansible
|
|
28
|
-
Requires-Dist: ansible-runner
|
|
29
|
-
Requires-Dist: paramiko
|
|
30
|
-
Requires-Dist: pydantic
|
|
31
|
-
Requires-Dist: pyyaml
|
|
32
|
-
Provides-Extra: dev
|
|
33
|
-
Requires-Dist: pytest; extra == "dev"
|
|
34
|
-
Requires-Dist: flake8; extra == "dev"
|
|
35
|
-
Requires-Dist: bump2version; extra == "dev"
|
|
36
|
-
Dynamic: author
|
|
37
|
-
Dynamic: author-email
|
|
38
|
-
Dynamic: classifier
|
|
39
|
-
Dynamic: description
|
|
40
|
-
Dynamic: description-content-type
|
|
41
|
-
Dynamic: home-page
|
|
42
|
-
Dynamic: keywords
|
|
43
|
-
Dynamic: license
|
|
44
|
-
Dynamic: license-file
|
|
45
|
-
Dynamic: project-url
|
|
46
|
-
Dynamic: provides-extra
|
|
47
|
-
Dynamic: requires-dist
|
|
48
|
-
Dynamic: requires-python
|
|
49
|
-
Dynamic: summary
|
|
50
|
-
|
|
51
|
-
# **VM Setup Tool**
|
|
52
|
-
### **A Comprehensive Solution for Streamlining Virtual Machine Configuration**
|
|
53
|
-
|
|
54
|
-
## **Overview**
|
|
55
|
-
The **VM Setup Tool** is an efficient, user-friendly solution designed to simplify the process of setting up and managing virtual machines (VMs) using Ansible. Ideal for automating VM deployment and configuration, this tool ensures consistency and enhances operational efficiency across your infrastructure.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## **Pre-requisites**
|
|
60
|
-
This tool supports projects utilizing **Docker Compose**.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## **Installation**
|
|
65
|
-
Install the VM Setup Tool using **pip**, the Python package manager:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pip install vm-tool
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## **Example Usage**
|
|
74
|
-
|
|
75
|
-
### **Automated VM Setup**
|
|
76
|
-
Use the following example to configure and run the VM setup:
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
80
|
-
|
|
81
|
-
config = SetupRunnerConfig(
|
|
82
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
83
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
84
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
85
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
86
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
87
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
88
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
runner = SetupRunner(config)
|
|
92
|
-
|
|
93
|
-
runner.run_setup()
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### **What Happens During Setup**
|
|
97
|
-
The VM Setup Tool will:
|
|
98
|
-
1. Configure Git with GitHub token if provided.
|
|
99
|
-
2. Clone the specified GitHub repository to your local machine.
|
|
100
|
-
3. Install **Docker** if it’s not already available on the target machine.
|
|
101
|
-
4. Install **Docker Compose** for managing multi-container applications.
|
|
102
|
-
5. Log in to Docker Hub if credentials are provided.
|
|
103
|
-
6. Create, enable, and start the Docker service.
|
|
104
|
-
7. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
105
|
-
|
|
106
|
-
By automating these tasks, the tool minimizes errors and saves time, allowing you to focus on development and deployment.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## **Cloud Setup**
|
|
111
|
-
The **VM Setup Tool** also supports cloud setup for VMs. Use the following example to configure and run the cloud setup:
|
|
112
|
-
|
|
113
|
-
```python
|
|
114
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig, SSHConfig
|
|
115
|
-
|
|
116
|
-
config = SetupRunnerConfig(
|
|
117
|
-
github_username='your_github_username', # Required if the repository is private, e.g., username
|
|
118
|
-
github_token='your_github_token', # Required if the repository is private, e.g., token
|
|
119
|
-
github_project_url='your_github_project_url', # e.g., https://github.com/username/repo
|
|
120
|
-
github_branch='your_branch_name', # Optional, defaults to 'main'
|
|
121
|
-
docker_compose_file_path='path_to_your_docker_compose_file', # Optional, defaults to 'docker-compose.yml'
|
|
122
|
-
dockerhub_username='your_dockerhub_username', # Required if DockerHub login is needed, e.g., dockerhub_user
|
|
123
|
-
dockerhub_password='your_dockerhub_password' # Required if DockerHub login is needed, e.g., dockerhub_password
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
runner = SetupRunner(config)
|
|
127
|
-
|
|
128
|
-
ssh_configs = [
|
|
129
|
-
SSHConfig(
|
|
130
|
-
ssh_username='your_ssh_username_1', # e.g., ssh_user_1
|
|
131
|
-
ssh_password='your_ssh_password_1', # Optional, only use if you don’t want to use SSH key
|
|
132
|
-
ssh_hostname='your_ssh_hostname_1', # e.g., ssh1.example.com
|
|
133
|
-
ssh_identity_file='/path/to/your/ssh_key_1' # Optional, path to SSH Identity file
|
|
134
|
-
),
|
|
135
|
-
SSHConfig(
|
|
136
|
-
ssh_username='your_ssh_username_2', # e.g., ssh_user_2
|
|
137
|
-
ssh_password='your_ssh_password_2', # Optional, only use if you don’t want to use SSH key
|
|
138
|
-
ssh_hostname='your_ssh_hostname_2', # e.g., ssh2.example.com
|
|
139
|
-
ssh_identity_file='/path/to/your/ssh_key_2' # Optional, path to SSH Identity file
|
|
140
|
-
)
|
|
141
|
-
# Add more SSHConfig instances as needed
|
|
142
|
-
]
|
|
143
|
-
|
|
144
|
-
runner.run_cloud_setup(ssh_configs)
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### **What Happens During Cloud Setup**
|
|
148
|
-
When you run the cloud setup, the tool will:
|
|
149
|
-
1. Connect to the specified cloud VM using SSH.
|
|
150
|
-
2. Configure Git with GitHub token if provided.
|
|
151
|
-
3. Clone the specified GitHub repository to the VM.
|
|
152
|
-
4. Install **Docker** if it’s not already available on the VM.
|
|
153
|
-
5. Install **Docker Compose** for managing multi-container applications.
|
|
154
|
-
6. Log in to Docker Hub if credentials are provided.
|
|
155
|
-
7. Create, enable, and start the Docker service on the VM.
|
|
156
|
-
8. Ensure the Docker container remains active, providing a robust environment for your applications.
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## **SSH Client Feature**
|
|
161
|
-
The **VM Setup Tool** also includes a dedicated **SSH client** feature to simplify the configuration of SSH access for VMs, including automated SSH key generation and management.
|
|
162
|
-
|
|
163
|
-
### **Example Usage**
|
|
164
|
-
|
|
165
|
-
```python
|
|
166
|
-
from vm_tool.ssh import SSHSetup
|
|
167
|
-
|
|
168
|
-
ssh_setup = SSHSetup(
|
|
169
|
-
hostname='your_vm_hostname', # e.g., vm.example.com
|
|
170
|
-
username='your_vm_username', # e.g., user
|
|
171
|
-
password='your_vm_password', # e.g., password
|
|
172
|
-
email='your_email_for_ssh_key' # e.g., user@example.com
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
ssh_setup.setup()
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### **What Happens During SSH Setup**
|
|
179
|
-
When you run the SSH setup, the tool will:
|
|
180
|
-
1. Generate an SSH key pair if none exists.
|
|
181
|
-
2. Read the public SSH key or create a new one if necessary.
|
|
182
|
-
3. Configure the VM by adding the public key to the VM's **authorized_keys** file.
|
|
183
|
-
4. Update the local SSH configuration file with the VM's details.
|
|
184
|
-
5. Establish an SSH connection to verify the setup.
|
|
185
|
-
6. Close the connection once setup is complete.
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Command Line Version Info
|
|
190
|
-
|
|
191
|
-
If you want to check the installed version of `vm_tool`, you can use the following command:
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
vm_tool --version
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
This will print the current version of the package.
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Python API Usage
|
|
202
|
-
|
|
203
|
-
The primary class for using the VM Setup Tool is `SetupRunner`, which orchestrates the entire setup process.
|
|
204
|
-
|
|
205
|
-
### **Example Usage**
|
|
206
|
-
|
|
207
|
-
```python
|
|
208
|
-
from vm_tool.runner import SetupRunner, SetupRunnerConfig
|
|
209
|
-
|
|
210
|
-
config = SetupRunnerConfig(
|
|
211
|
-
# Configuration options
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
runner = SetupRunner(config)
|
|
215
|
-
|
|
216
|
-
runner.run_setup()
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### **Configuration Options**
|
|
220
|
-
- `github_username`: Your GitHub username (required for private repositories).
|
|
221
|
-
- `github_token`: A GitHub token with repo access (required for private repositories).
|
|
222
|
-
- `github_project_url`: The URL of your GitHub project.
|
|
223
|
-
- `github_branch`: The branch of the GitHub repository to use.
|
|
224
|
-
- `docker_compose_file_path`: Path to your Docker Compose file.
|
|
225
|
-
- `dockerhub_username`: Your Docker Hub username (if Docker Hub login is needed).
|
|
226
|
-
- `dockerhub_password`: Your Docker Hub password (if Docker Hub login is needed).
|
|
227
|
-
|
|
228
|
-
### **Methods**
|
|
229
|
-
- `run_setup()`: Executes the VM setup process.
|
|
230
|
-
- `run_cloud_setup(ssh_configs)`: Executes the cloud VM setup process using the provided SSH configurations.
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
With its comprehensive features, the **VM Setup Tool** eliminates the hassle of manual configurations and enables seamless integration of VMs into your workflows. Start using the tool today to automate and optimize your virtual machine setup process.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|