## Description Add Vmware template to coder ## Type of Change - [ ] New module - [x] New template - [ ] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Template Information <!-- Delete this section if not applicable --> **Path:** `registry/anis/templates/vmware-linux` ## Testing & Validation - [x] Tests pass (`bun test`) - [x] Code formatted (`bun fmt`) - [x] Changes tested locally https://github.com/user-attachments/assets/ffc787a8-4335-4602-a405-c475f0cad62b ## Related Issues Closes #211 /claim #211 <!-- Link related issues or write "None" if not applicable --> --------- Signed-off-by: Anis KHALFALLAH <khalfallah.anis@hotmail.com> Co-authored-by: DevCats <christofer@coder.com>
57 lines
1.2 KiB
Plaintext
57 lines
1.2 KiB
Plaintext
#cloud-config
|
|
hostname: ${hostname}
|
|
users:
|
|
- name: ${username}
|
|
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
|
groups: sudo
|
|
shell: /bin/bash
|
|
packages:
|
|
- git
|
|
- curl
|
|
- wget
|
|
- unzip
|
|
disk_setup:
|
|
/dev/sdb:
|
|
table_type: "gpt"
|
|
layout: true
|
|
overwrite: false
|
|
fs_setup:
|
|
- label: ${home_volume_label}
|
|
filesystem: ext4
|
|
device: /dev/sdb
|
|
partition: auto
|
|
mounts:
|
|
- ["/dev/sdb", "/home/${username}", "ext4", "defaults", "0", "2"]
|
|
write_files:
|
|
- path: /opt/coder/init
|
|
permissions: "0755"
|
|
encoding: b64
|
|
content: ${init_script}
|
|
- path: /etc/systemd/system/coder-agent.service
|
|
permissions: "0644"
|
|
content: |
|
|
[Unit]
|
|
Description=Coder Agent
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
User=${username}
|
|
ExecStart=/opt/coder/init
|
|
Environment=CODER_AGENT_TOKEN=${coder_agent_token}
|
|
Restart=always
|
|
RestartSec=10
|
|
TimeoutStopSec=90
|
|
KillMode=process
|
|
|
|
OOMScoreAdjust=-1000
|
|
SyslogIdentifier=coder-agent
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
runcmd:
|
|
- mkdir -p /home/${username}
|
|
- chown ${username}:${username} /home/${username}
|
|
- systemctl enable coder-agent
|
|
- systemctl start coder-agent
|