Skip to content

Instantly share code, notes, and snippets.

@felixfontein
Last active September 12, 2020 21:32
Show Gist options
  • Save felixfontein/06995539f9fc7b06150ab3fe5d80c14e to your computer and use it in GitHub Desktop.
Save felixfontein/06995539f9fc7b06150ab3fe5d80c14e to your computer and use it in GitHub Desktop.
Deprecation in Collections and Ansible 2.10+

The collection name used in ansible/ansible is ansible.builtin.

  1. Module/plugin deprecation:
    • deprecated entry in DOCUMENTATION with:
      • why, alternative (required)
      • either removed_in: <version> or removed_at_date: <date>
      • (removed_from_collection is automatically inserted if not present)
    • deprecation entry in meta/runtime.yml with:
      • warning_text (optional)
      • either removal_version: <version> or removal_date: <date>
  2. Plugin option deprecation in DOCUMENTATION (for option itself, for ini entry, for vars entry, for env entry)
    • why (required)
    • alternatives (optional)
    • either version: <version> or date: <date>
    • (collection_name is automatically inserted if not present)
  3. Module argument spec option deprecation:
    • either removed_in_version="<version>" or removed_at_date="<date>"
    • removed_from_collection="<namespace.name>" (required)
  4. Module argument spec alias deprecation:
    • name="<alias>" (required)
    • collection_name="<namespace.name>" (required)
    • either version="<version>" or date="<date>"
  5. Display.deprecated() and AnsibleModule.deprecate() calls
    • first positional argument msg (required)
    • either version="<version>" or date="<date>"
    • collection_name="<namespace.name>" (required)
@felixfontein
Copy link
Author

felixfontein commented Jun 16, 2020

Update: the field in top-level deprecated is called removed_from_collection, not collection_name. (It is auto-inserted, so this should affect anyone.)

@felixfontein
Copy link
Author

Update: in point 2, the key is called alternatives, not alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment