OpenTofu Global Configuration

The org.ysb33r.opentofu.rc allows for global configuration of OpenTofu. If you have a single project layout this, plugin is automatically applied when you apply org.ysb33r.opentofu. However, when you have a multi-project layout and you do no need org.ysb33r.opentofu in the root project, you need to apply org.ysb33r.opentofu.rc to the root.

The extension in the root project can be configured as follows.

opentofurc {
  disableCheckpoint = true (1)
  disableCheckPointSignature = false (2)
  pluginCacheMayBreakDependencyLockFile = false (3)
  useGlobalConfig = false (4)
  pluginCacheDir = '/my/cache/location' (5)
  pluginCacheLockTimeout = 300000 (6)
  credentials('user','pass') (7)
}
1 When set to true, disables upgrade and security bulletin checks that require reaching out to certain provided network services. Default is true.
2 When set to true, allows the upgrade and security bulletin checks described above but disables the use of an anonymous id used to de-duplicate warning messages. Default is false
3 Setting this option gives Terraform/OpenTofu CLI permission to create an incomplete dependency lock file entry for a provider if that would allow Terraform/OpenTofu to use the cache to install that provider. Default is false.
4 When set to {@code true} use global configuration rather than the Gradle root project configuration.
5 Override the location of this plugin cache directory. By default, Gradle will try to lock concurrent update access, but it will only work for Gradle tasks. if there is any terraform init or tofu init that uses this configured directory for the plugin cache and that process runs concurrently to any Gradle tfInit/tofoInit tasks, it can break the plugin cache.
6 Set the timeout on the write lock access to the cache directory in milliseconds. The default is 5min. Adjust that if you have the possibility of a clean update taking longer than that. Set it to zero, if no locking should be performed.
7 Set credentials you want to store in the config file.

All of the API is documented at AbstractGlobalConfigExtension.