Skip to content

Commit 72422b8

Browse files
committed
Deprecate the ansible provision mode and playbook
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
1 parent 56702e0 commit 72422b8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-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("ansible provision mode is deprecated, use `ansible-playbook %q` instead", 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
@@ -256,6 +256,8 @@ containerd:
256256
# # It requires `ansible-playbook` command to be installed.
257257
# # Environment variables such as ANSIBLE_CONFIG can be used, to control the behavior of the playbook execution.
258258
# # See ansible docs, and `ansible-config`, for more info https://docs.ansible.com/ansible/latest/playbook_guide/
259+
# # DEPRECATED The ansible mode is deprecated, and should not be used. Instead call ansible-playbook directly,
260+
# # either from the host after the instance is started or from the instance by running ansible locally instead.
259261
# - mode: ansible
260262
# playbook: playbook.yaml
261263
# # `data` is a file that is written to the guest filesystem and not executed at all.

0 commit comments

Comments
 (0)