Skip to content

Commit 61fdb7f

Browse files
committed
Deprecate the ansible provision mode and playbook
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 3fea800 commit 61fdb7f

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

pkg/limayaml/limayaml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const (
221221
ProvisionModeUser ProvisionMode = "user"
222222
ProvisionModeBoot ProvisionMode = "boot"
223223
ProvisionModeDependency ProvisionMode = "dependency"
224-
ProvisionModeAnsible ProvisionMode = "ansible"
224+
ProvisionModeAnsible ProvisionMode = "ansible" // DEPRECATED
225225
ProvisionModeData ProvisionMode = "data"
226226
)
227227

@@ -230,7 +230,7 @@ type Provision struct {
230230
SkipDefaultDependencyResolution *bool `yaml:"skipDefaultDependencyResolution,omitempty" json:"skipDefaultDependencyResolution,omitempty"`
231231
Script string `yaml:"script" json:"script"`
232232
File *LocatorWithDigest `yaml:"file,omitempty" json:"file,omitempty" jsonschema:"nullable"`
233-
Playbook string `yaml:"playbook,omitempty" json:"playbook,omitempty"`
233+
Playbook string `yaml:"playbook,omitempty" json:"playbook,omitempty"` // DEPRECATED
234234
// All ProvisionData fields must be nil unless Mode is ProvisionModeData
235235
ProvisionData `yaml:",inline"` // Flatten fields for "strict" YAML mode
236236
}

pkg/limayaml/validate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ func Validate(y *LimaYAML, warn bool) error {
277277
if _, err := os.Stat(playbook); err != nil {
278278
return fmt.Errorf("field `provision[%d].playbook` refers to an inaccessible path: %q: %w", i, playbook, err)
279279
}
280+
logrus.Warnf("provision mode %q is deprecated, use `ansible-playbook %q` instead", ProvisionModeAnsible, playbook)
280281
}
281282
if strings.Contains(p.Script, "LIMA_CIDATA") {
282283
logrus.Warn("provisioning scripts should not reference the LIMA_CIDATA variables")

templates/default.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ containerd:
230230
# # It requires `ansible-playbook` command to be installed.
231231
# # Environment variables such as ANSIBLE_CONFIG can be used, to control the behavior of the playbook execution.
232232
# # See ansible docs, and `ansible-config`, for more info https://docs.ansible.com/ansible/latest/playbook_guide/
233+
# # DEPRECATED The ansible mode is deprecated, and should not be used. Instead call ansible-playbook directly,
234+
# # either from the host after the instance is started or from the instance by running ansible locally instead.
233235
# - mode: ansible
234236
# playbook: playbook.yaml
235237
# # `data` is a file that is written to the guest filesystem and not executed at all.

website/content/en/docs/releases/deprecated.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The following features are deprecated:
99
- Loading non-strict YAMLs (i.e., YAMLs with unknown properties)
1010
- `limactl show-ssh` command (Use `ssh -F ~/.lima/default/ssh.config lima-default` instead)
1111
- `LIMA_SSH_PORT_FORWARDER=true` (since Lima v1.1)
12+
- Ansible provisioning mode (Use `ansible-playbook playbook.yaml` after the start instead)
1213

1314
## Removed features
1415
- YAML property `network`: deprecated in [Lima v0.7.0](https://github.com/lima-vm/lima/commit/07e68230e70b21108d2db3ca5e0efd0e43842fbd)

0 commit comments

Comments
 (0)