Skip to content

Commit

Permalink
(bug) Allow 'version' key in inventory files
Browse files Browse the repository at this point in the history
When running `bolt project migrate` we don't remove the `version` key if
the value is `2`, but we still raise a warning that the `version` key
isn't recognized. This amends the inventoryfile schema to include the
`version` key so that users don't see a warning.

!bug

* **Allow 'version' key in inventory files**

  Bolt now recognizes the `version` configuration in an inventoryfile
  and doesn't raise a warning that the key is unknown.
  • Loading branch information
lucywyman committed Mar 29, 2021
1 parent a0e78ab commit 6c60cf6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/bolt/inventory/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Options
plugin_hooks
targets
vars
version
].freeze

# Definitions used to validate the data.
Expand Down Expand Up @@ -124,6 +125,12 @@ module Options
description: "A map of variables for the group or target.",
type: Hash,
_plugin: true
},
"version" => {
description: "The version of the inventoryfile.",
type: Integer,
_plugin: false,
_example: 2
}
}.freeze
end
Expand Down
14 changes: 14 additions & 0 deletions schemas/bolt-inventory.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,10 @@
"$ref": "#/definitions/_plugin"
}
]
},
"version": {
"description": "The version of the inventoryfile.",
"type": "integer"
}
},
"oneOf": [
Expand Down Expand Up @@ -1449,6 +1453,16 @@
}
]
},
"plugin_hooks": {
"oneOf": [
{
"$ref": "#/definitions/plugin_hooks"
},
{
"$ref": "#/definitions/_plugin"
}
]
},
"targets": {
"oneOf": [
{
Expand Down

0 comments on commit 6c60cf6

Please sign in to comment.