Setting machine restart policy in fly.toml?

Hi, back in this 2022 thread it sounded like this is in the works, but I can find no way to specify my machine restart policy in fly.toml.

In the mean time, I have something like this in my deployment script:

      /root/.fly/bin/flyctl machines list --json |
      jq -r '.[] | select(.config.restart.policy != "always") | .id' |
      while read machine_id; do
        /root/.fly/bin/flyctl machine update $machine_id --restart always --yes
      done

Is there a better approach?

Ahh, replying to myself. It seems this was actually added about a month ago - it just hasn’t shown up in the fly.toml documentation yet - as someone noted in that thread also.

1 Like

Added docs, machines

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.