Skip to content

Commit 8b69c5d

Browse files
committed
refactor: reorganize config structure under tofu/ directory
- Create new config/tofu/ directory to group OpenTofu configurations - Move config/lxd/ and config/multipass/ into config/tofu/ - Update all documentation links in README.md - Update GitHub workflow paths to use new structure - Update workflow comments to reference correct paths This reorganization better reflects that both configurations use OpenTofu and provides clearer project structure.
1 parent 211f683 commit 8b69c5d

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

.github/workflows/test-lxd-provision.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test LXD Container Provisioning
22

33
# NOTE: This workflow uses CI-specific approaches like 'sudo chmod 666' on the LXD socket
44
# and 'sudo' with LXD commands. These approaches are NOT recommended for local development.
5-
# For local use, follow the proper group membership approach documented in config/lxd/README.md
5+
# For local use, follow the proper group membership approach documented in config/tofu/lxd/README.md
66

77
on:
88
push:
@@ -53,19 +53,19 @@ jobs:
5353
tofu version
5454
5555
- name: Initialize OpenTofu
56-
working-directory: config/lxd
56+
working-directory: config/tofu/lxd
5757
run: tofu init
5858

5959
- name: Validate OpenTofu configuration
60-
working-directory: config/lxd
60+
working-directory: config/tofu/lxd
6161
run: tofu validate
6262

6363
- name: Plan deployment
64-
working-directory: config/lxd
64+
working-directory: config/tofu/lxd
6565
run: tofu plan
6666

6767
- name: Apply configuration
68-
working-directory: config/lxd
68+
working-directory: config/tofu/lxd
6969
run: |
7070
# Run with sudo to ensure LXD access in CI environment
7171
# NOTE: For local development, use "sg lxd -c 'tofu apply'" instead
@@ -129,12 +129,12 @@ jobs:
129129
sudo lxc exec torrust-vm -- systemctl status ssh || echo "ssh service check failed"
130130
131131
- name: Get container outputs
132-
working-directory: config/lxd
132+
working-directory: config/tofu/lxd
133133
run: sudo -E tofu output
134134

135135
- name: Cleanup
136136
if: always()
137-
working-directory: config/lxd
137+
working-directory: config/tofu/lxd
138138
run: |
139139
echo "Cleaning up container..."
140140
# Use sudo for CI environment cleanup

.github/workflows/test-multipass-provision.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ jobs:
6565
tofu version
6666
6767
- name: Initialize OpenTofu
68-
working-directory: config/multipass
68+
working-directory: config/tofu/multipass
6969
run: tofu init
7070

7171
- name: Validate OpenTofu configuration
72-
working-directory: config/multipass
72+
working-directory: config/tofu/multipass
7373
run: tofu validate
7474

7575
- name: Plan deployment
76-
working-directory: config/multipass
76+
working-directory: config/tofu/multipass
7777
run: tofu plan
7878

7979
- name: Apply configuration
80-
working-directory: config/multipass
80+
working-directory: config/tofu/multipass
8181
run: |
8282
# Run with sudo to ensure multipass access
8383
sudo -E tofu apply -auto-approve
@@ -125,12 +125,12 @@ jobs:
125125
sudo multipass exec torrust-vm -- free -h || echo "free failed"
126126
127127
- name: Get VM outputs
128-
working-directory: config/multipass
128+
working-directory: config/tofu/multipass
129129
run: sudo -E tofu output
130130

131131
- name: Cleanup
132132
if: always()
133-
working-directory: config/multipass
133+
working-directory: config/tofu/multipass
134134
run: |
135135
echo "Cleaning up VM..."
136136
sudo -E tofu destroy -auto-approve || true

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ This repository contains configurations for testing VM provisioning and cloud-in
1414

1515
This repository tests two different virtualization technologies:
1616

17-
### 🖥️ **Multipass (`config/multipass/`)**
17+
### 🖥️ **Multipass (`config/tofu/multipass/`)**
1818

1919
- **Technology**: Full VMs with nested virtualization
2020
- **Status**: ⚠️ Works in GitHub Actions but undocumented
2121
- **Best for**: Local development, full VM isolation
2222
- **Requirements**: Nested virtualization support
2323

24-
**[📖 See detailed documentation →](config/multipass/README.md)**
24+
**[📖 See detailed documentation →](config/tofu/multipass/README.md)**
2525

26-
### ☁️ **LXD Containers (`config/lxd/`)**
26+
### ☁️ **LXD Containers (`config/tofu/lxd/`)**
2727

2828
- **Technology**: System containers with cloud-init support
2929
- **Status**: ✅ Guaranteed GitHub Actions compatibility
3030
- **Best for**: CI/CD environments, fast provisioning
3131
- **Requirements**: No special virtualization needed
3232

33-
**[📖 See detailed documentation →](config/lxd/README.md)**
33+
**[📖 See detailed documentation →](config/tofu/lxd/README.md)**
3434

3535
## 🔄 **Quick Comparison**
3636

@@ -49,8 +49,8 @@ This repository tests two different virtualization technologies:
4949

5050
Choose your preferred approach:
5151

52-
1. **For local development**: Start with [Multipass configuration](config/multipass/README.md)
53-
2. **For CI/CD reliability**: Use [LXD configuration](config/lxd/README.md)
52+
1. **For local development**: Start with [Multipass configuration](config/tofu/multipass/README.md)
53+
2. **For CI/CD reliability**: Use [LXD configuration](config/tofu/lxd/README.md)
5454
3. **For testing both**: Try both approaches to compare
5555

5656
## 🧪 **Testing in GitHub Actions**
@@ -86,14 +86,15 @@ Both configurations include GitHub Actions workflows for CI testing:
8686

8787
```text
8888
├── config/
89-
│ ├── multipass/
90-
│ │ ├── main.tf # OpenTofu configuration for Multipass VMs
91-
│ │ ├── cloud-init.yml # Cloud-init configuration
92-
│ │ └── README.md # Multipass-specific documentation
93-
│ └── lxd/
94-
│ ├── main.tf # OpenTofu configuration for LXD containers
95-
│ ├── cloud-init.yml # Cloud-init configuration (same as multipass)
96-
│ └── README.md # LXD-specific documentation
89+
│ └── tofu/
90+
│ ├── multipass/
91+
│ │ ├── main.tf # OpenTofu configuration for Multipass VMs
92+
│ │ ├── cloud-init.yml # Cloud-init configuration
93+
│ │ └── README.md # Multipass-specific documentation
94+
│ └── lxd/
95+
│ ├── main.tf # OpenTofu configuration for LXD containers
96+
│ ├── cloud-init.yml # Cloud-init configuration (same as multipass)
97+
│ └── README.md # LXD-specific documentation
9798
├── .github/
9899
│ └── workflows/
99100
│ ├── test-multipass-provision.yml # Tests Multipass VMs
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)