You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: community/modules/scripts/vdi-setup/README.md
+45-75Lines changed: 45 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,37 @@
2
2
3
3
Creates a containerised Guacamole instance. Works with the Rocky, Debian and Ubuntu images shown in blueprint example below.
4
4
5
-
### Secret Manager Integration
5
+
##Features
6
6
7
-
The VDI module supports flexible Secret Manager integration:
7
+
-**VDI Tool Support**: Currently supports Guacamole for web-based VDI access
8
+
-**User Provisioning**: Supports local user creation with secure password management
9
+
-**VNC Integration**: Configures VNC servers for desktop access
10
+
-**Secret Manager Integration**: Secure password storage and retrieval for VDI users and webapp admin
11
+
-**VDI Monitoring System**: Automatic monitoring and reconfiguration capabilities with password reset flags and deployment status updates
12
+
-**Debug Mode**: Comprehensive logging when enabled via the `debug` variable
8
13
9
-
-**Default Behavior**: Secrets are stored in the deployment project
10
-
-**Automatic Password Generation**: If no `secret_name` is provided, random passwords are generated and stored
11
-
-**Existing Secret Retrieval**: Provide `secret_name` to use existing secrets from Secret Manager
12
-
-**Cross-Project Secrets**: Use `secret_project` to specify a different GCP project if providing secrets
14
+
## Secret Manager Integration
13
15
14
-
## Basic Example (Guacamole)
16
+
The module integrates with Google Cloud Secret Manager for secure password handling:
17
+
18
+
-**VDI Users**: Passwords are stored in Secret Manager with the pattern `vdi-user-password-{username}-{deployment_name}`
19
+
-**Webapp Admin**: Password is stored in Secret Manager with the pattern `webapp-server-password-{deployment_name}` (always stored, not just when reset is enabled)
20
+
-**Password Sources**: Users can specify `secret_name` to fetch existing passwords, provide `password` directly, or let the system generate random passwords
21
+
-**Reset Functionality**: Both individual user passwords (`reset_password`) and webapp admin password (`reset_webapp_admin_password`) can be forced to regenerate
22
+
-**Database Updates**: Password resets update existing database records without re-initializing the entire database
23
+
24
+
## VDI Monitoring System
25
+
26
+
The module includes a monitoring system that:
27
+
28
+
-**Deployment Status**: Updates instance metadata to reflect deployment state (`available`, `reconfiguring`)
29
+
-**Password Reset Flags**: Supports `reset_password` for individual users and `reset_webapp_admin_password` for the webapp admin account
30
+
-**Automatic Reconfiguration**: Detects changes and triggers reconfiguration when needed
31
+
-**Status Tracking**: Maintains deployment status through instance metadata
32
+
33
+
## Usage
34
+
35
+
### Basic Configuration
15
36
16
37
```yaml
17
38
blueprint_name: vdi-test
@@ -51,9 +72,13 @@ deployment_groups:
51
72
settings:
52
73
vnc_flavor: tigervnc
53
74
vdi_tool: guacamole
54
-
user_provision: local_users
55
75
vdi_user_group: vdiusers
56
76
vdi_resolution: 1920x1080
77
+
# Enable debug mode for verbose logging
78
+
debug: true
79
+
# Force reset of webapp admin password (optional)
80
+
reset_webapp_admin_password: false
81
+
user_provision: local_users
57
82
vdi_users:
58
83
# Alice: password generated and saved to Secret Manager in deployment project
59
84
- username: alice
@@ -67,6 +92,10 @@ deployment_groups:
67
92
port: 5903
68
93
secret_name: charlie-password
69
94
secret_project: another-project-id
95
+
# David: auto-generated password with reset flag (triggers password regeneration)
After deployment, you can access the VDI in several ways:
104
135
105
-
1. **Guacamole Web Interface**:
136
+
1. **Web Interface** (for Guacamole):
106
137
- Access web interface:
107
138
- http://$VM_PUBLIC_IP:8080/guacamole/#/
108
-
- Note: It is not advisable to serve Guacamole directly from a public IP in production environments. You should consider placing the VDI behind a reverse proxy, load balancer, or tunnel to it directly over IAP (see below).
139
+
- Note: It is not advisable to serve the web interface directly from a public IP in production environments. You should consider placing the VDI behind a reverse proxy, load balancer, or tunnel to it directly over IAP (see below).
109
140
110
141
- Admin credentials:
111
-
- Username: `guacadmin`
112
-
- Password: Retrieve the `webapp-server...` secret from Secret Manager
142
+
- Username: `guacadmin`(for Guacamole)
143
+
- Password: Retrieve the `webapp-server-password-{deployment_name}` secret from Secret Manager
113
144
114
145
2. **User VDI Access**:
115
146
- Each user's credentials are stored in Secret Manager
@@ -124,65 +155,4 @@ After deployment, you can access the VDI in several ways:
124
155
--zone=us-central1-a
125
156
```
126
157
127
-
- Guacamole will then be accessible from http://localhost:8080/guacamole/
128
-
129
-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | The name of the deployment. | `string` | n/a | yes |
165
-
| <a name="input_labels"></a> [labels](#input\_labels) | Key-value pairs of labels to be added to created resources. | `map(string)` | n/a | yes |
166
-
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which the HPC deployment will be created. | `string` | n/a | yes |
167
-
| <a name="input_region"></a> [region](#input\_region) | Region to place bucket containing startup script. | `string` | n/a | yes |
168
-
| <a name="input_user_provision"></a> [user\_provision](#input\_user\_provision) | User type to create (local\_users supported. os-login to do. | `string` | `"local_users"` | no |
169
-
| <a name="input_vdi_resolution"></a> [vdi\_resolution](#input\_vdi\_resolution) | Desktop resolution for VNC sessions (e.g. 1920x1080). | `string` | `"1920x1080"` | no |
170
-
| <a name="input_vdi_tool"></a> [vdi\_tool](#input\_vdi\_tool) | VDI tool to deploy (guacamole currently supported). | `string` | `"guacamole"` | no |
171
-
| <a name="input_vdi_user_group"></a> [vdi\_user\_group](#input\_vdi\_user\_group) | Unix group to create/use for VDI users. | `string` | `"vdiusers"` | no |
172
-
| <a name="input_vdi_users"></a> [vdi\_users](#input\_vdi\_users) | List of VDI users to configure. Passwords are handled securely by the Ansible roles: if secret\_name is provided, the password is fetched from Secret Manager; if neither password nor secret\_name is provided, a random password is generated and stored in Secret Manager. If secret\_project is provided, it specifies the GCP project where the secret is stored (defaults to the deployment project). | <pre>list(object({<br/> username = string<br/> port = number<br/> secret_name = optional(string)<br/> secret_project = optional(string)<br/> }))</pre> | `[]` | no |
173
-
| <a name="input_vdi_webapp_port"></a> [vdi\_webapp\_port](#input\_vdi\_webapp\_port) | Port to serve the Webapp interface from if applicable | `string` | `"8080"` | no |
174
-
| <a name="input_vnc_flavor"></a> [vnc\_flavor](#input\_vnc\_flavor) | The VNC server flavor to use (tigervnc currently supported) | `string` | `"tigervnc"` | no |
175
-
| <a name="input_vnc_port_max"></a> [vnc\_port\_max](#input\_vnc\_port\_max) | Maximum valid VNC port. | `number` | `5999` | no |
| <a name="input_debug"></a> [debug](#input\_debug) | Enable debug mode for verbose logging during VDI setup. | `bool` | `false` | no |
178
-
179
-
## Outputs
180
-
181
-
| Name | Description |
182
-
|------|-------------|
183
-
| <a name="output_guacamole_admin_password_secret"></a> [guacamole\_admin\_password\_secret](#output\_guacamole\_admin\_password\_secret) | The name of the Secret Manager secret containing the Guacamole admin password |
184
-
| <a name="output_guacamole_admin_username"></a> [guacamole\_admin\_username](#output\_guacamole\_admin\_username) | The admin username for Guacamole |
| <a name="output_vdi_runner"></a> [vdi\_runner](#output\_vdi\_runner) | Shell runner wrapping Ansible playbook + roles (for custom-image or direct use). |
187
-
| <a name="output_vdi_user_credentials"></a> [vdi\_user\_credentials](#output\_vdi\_user\_credentials) | Map of VDI user credentials stored in Secret Manager |
188
-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
158
+
- The web interface will then be accessible from http://localhost:8080/guacamole/ (for Guacamole)
0 commit comments