Skip to content

Commit b2c5e35

Browse files
Merge pull request #1 from MonolithProjects/develop
Optional Autostart
2 parents 257cc20 + c4d76ac commit b2c5e35

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# How to contribute
2+
3+
Feel free to:
4+
5+
- [Create an issue](https://help.github.com/articles/creating-an-issue/)
6+
- [Make a pull request](https://services.github.com/on-demand/github-cli/open-pull-request-github) into the `develop` branch
7+
8+
## :wrench: Here is how you can help...
9+
10+
### 1. Create an issue
11+
12+
When you see some issue or have an idea for improvement, [create an issue](https://github.com/monolithprojects/terraform-libvirt-vm/issues).
13+
14+
### 2. Fork the project
15+
16+
Click on `fork` on the top-right corner and fork the repository.
17+
18+
### 3. Make the changes
19+
20+
Do the changes in your own GitHub namespace.
21+
22+
### 4. Test the changes
23+
24+
**Note:** I will test the module again, so you don't need to do that if you don't want to.
25+
26+
### 5. Create a pull request
27+
28+
Please create a pull request into the `develop` branch. Here is [how to do it](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).
29+
30+
31+
Please consider to [sponsor](https://github.com/sponsors/monolithprojects) me :smirk:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Terraform module for KVM/Libvirt Virtual Machine. This module will create a KVM
2222
| Parameter | Description | Default value
2323
|-----------------|-----|-----
2424
|os_img_url|URL to the OS image|https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
25+
|autostart| Autostart the Domain| true
2526
|vm_count|Number of VMs| 1
2627
|index_start|From where the index start| 1
2728
|vm_hostname_prefix|VM hostname prefix|vm

modules/virt-machine/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resource "libvirt_domain" "virt-machine" {
1414
name = format("${var.vm_hostname_prefix}%02d", count.index + var.index_start)
1515
memory = var.memory
1616
vcpu = var.vcpu
17-
autostart = true
17+
autostart = var.autostart
1818
qemu_agent = true
1919

2020
cloudinit = element(libvirt_cloudinit_disk.commoninit.*.id, count.index)

modules/virt-machine/variables.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ variable "os_img_url" {
33
default = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
44
}
55

6+
variable "autostart" {
7+
description = "Autostart the domain"
8+
default = true
9+
}
10+
611
variable "vm_count" {
712
description = "Number of VMs"
813
default = 1
@@ -74,7 +79,7 @@ variable "dhcp" {
7479

7580
variable "bridge" {
7681
description = "Bridge interface"
77-
default = "br0"
82+
default = "virbr0"
7883
}
7984

8085
variable "ip_address" {

0 commit comments

Comments
 (0)