DevCats ad61bddfb2
chore: fix module reference in coder-utils (#826)
## Description

fix module reference in coder-utils
<!-- Briefly describe what this PR does and why -->

## Type of Change

- [ ] New module
- [ ] New template
- [x] Bug fix
- [ ] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information


**Path:** `registry/coder/modules/coder-utils`  
**New version:** `v1.0.1`  
**Breaking change:** [ ] Yes [x] No

## Testing & Validation

- [X] Tests pass (`bun test`)
- [X] Code formatted (`bun fmt`)
- [X] Changes tested locally

## Related Issues

<!-- Link related issues or write "None" if not applicable -->
2026-04-02 07:56:09 -05:00

1.9 KiB

display_name description icon verified tags
Coder Utils Building block for modules that need orchestrated script execution ../../../../.icons/coder.svg false
internal
library

Coder Utils

Caution

We do not recommend using this module directly. It is intended primarily for internal use by Coder to create modules with orchestrated script execution.

The Coder Utils module is a building block for modules that need to run multiple scripts in a specific order. It uses coder exp sync for dependency management and is designed for orchestrating pre-install, install, post-install, and start scripts.

Note

  • The agent_name should be the same as that of the agentapi module's agent_name if used together.
module "coder_utils" {
  source  = "registry.coder.com/coder/coder-utils/coder"
  version = "1.0.1"

  agent_id        = coder_agent.main.id
  agent_name      = "myagent"
  module_dir_name = ".my-module"

  pre_install_script = <<-EOT
    #!/bin/bash
    echo "Running pre-install tasks..."
    # Your pre-install logic here
  EOT

  install_script = <<-EOT
    #!/bin/bash
    echo "Installing dependencies..."
    # Your install logic here
  EOT

  post_install_script = <<-EOT
    #!/bin/bash
    echo "Running post-install configuration..."
    # Your post-install logic here
  EOT

  start_script = <<-EOT
    #!/bin/bash
    echo "Starting the application..."
    # Your start logic here
  EOT
}

Execution Order

The module orchestrates scripts in the following order:

  1. Log File Creation - Creates module directory and log files
  2. Pre-Install Script (optional) - Runs before installation
  3. Install Script - Main installation
  4. Post-Install Script (optional) - Runs after installation
  5. Start Script - Starts the application

Each script waits for its prerequisites to complete before running using coder exp sync dependency management.