diff --git a/changelogs/fragments/remove-role-entrypoint-attrs.yml b/changelogs/fragments/remove-role-entrypoint-attrs.yml new file mode 100644 index 00000000000..97168e884b8 --- /dev/null +++ b/changelogs/fragments/remove-role-entrypoint-attrs.yml @@ -0,0 +1,2 @@ +removed_features: + - "ansible-doc - role entrypoint attributes are no longer shown" diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 9f6def99462..967ce4911d2 100755 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -1431,23 +1431,6 @@ class DocCLI(CLI, RoleMixin): text.append(_format("Options", 'bold') + " (%s indicates it is required):" % ("=" if C.ANSIBLE_NOCOLOR else 'red')) DocCLI.add_fields(text, doc.pop('options'), limit, opt_indent) - if doc.get('attributes', False): - display.deprecated( - f'The role {role}\'s argument spec {entry_point} contains the key "attributes", ' - 'which will not be displayed by ansible-doc in the future. ' - 'This was unintentionally allowed when plugin attributes were added, ' - 'but the feature does not map well to role argument specs.', - version='2.20', - ) - text.append("") - text.append(_format("ATTRIBUTES:", 'bold')) - for k in doc['attributes'].keys(): - text.append('') - text.append(DocCLI.warp_fill(DocCLI.tty_ify(_format('%s:' % k, 'UNDERLINE')), limit - 6, initial_indent=opt_indent, - subsequent_indent=opt_indent)) - text.append(DocCLI._indent_lines(DocCLI._dump_yaml(doc['attributes'][k]), opt_indent)) - del doc['attributes'] - if notes := doc.pop('notes', False): text.append("") text.append(_format("NOTES:", 'bold')) diff --git a/test/integration/targets/ansible-doc/collections/ansible_collections/testns/testcol/roles/testrole/meta/main.yml b/test/integration/targets/ansible-doc/collections/ansible_collections/testns/testcol/roles/testrole/meta/main.yml index 6d9c4aa0b88..fefe8913df7 100644 --- a/test/integration/targets/ansible-doc/collections/ansible_collections/testns/testcol/roles/testrole/meta/main.yml +++ b/test/integration/targets/ansible-doc/collections/ansible_collections/testns/testcol/roles/testrole/meta/main.yml @@ -20,10 +20,6 @@ argument_specs: description: - Longer description for testns.testcol.testrole alternate entry point. author: Ansible Core (@ansible) - attributes: - check_mode: - description: Can run in check_mode and return changed status prediction without modifying target - support: full version_added: 2.1.0 options: altopt1: diff --git a/test/integration/targets/ansible-doc/fakecollrole.output b/test/integration/targets/ansible-doc/fakecollrole.output index 1f88bf0cd33..2c6f53cb341 100644 --- a/test/integration/targets/ansible-doc/fakecollrole.output +++ b/test/integration/targets/ansible-doc/fakecollrole.output @@ -12,13 +12,6 @@ Options (= indicates it is required): = altopt1 altopt1 description type: int -ATTRIBUTES: - - `check_mode:` - description: Can run in check_mode and return changed status prediction without modifying - target - support: full - AUTHOR: Ansible Core (@ansible) EXAMPLES: diff --git a/test/integration/targets/ansible-doc/fakerole.output b/test/integration/targets/ansible-doc/fakerole.output index 2c89ebcbbd0..e5cc1008a1e 100644 --- a/test/integration/targets/ansible-doc/fakerole.output +++ b/test/integration/targets/ansible-doc/fakerole.output @@ -27,14 +27,6 @@ Options (= indicates it is required): default: null type: str -ATTRIBUTES: - - `diff_mode:` - description: Will return details on what has changed (or possibly needs changing in - check_mode), when in diff mode - details: Not all modules used support this - support: partial - NOTES: * This is a role. * More text. diff --git a/test/integration/targets/ansible-doc/roles/test_role1/meta/argument_specs.yml b/test/integration/targets/ansible-doc/roles/test_role1/meta/argument_specs.yml index 5abd3fab5d0..eb782da9585 100644 --- a/test/integration/targets/ansible-doc/roles/test_role1/meta/argument_specs.yml +++ b/test/integration/targets/ansible-doc/roles/test_role1/meta/argument_specs.yml @@ -11,11 +11,6 @@ argument_specs: author: - John Doe (@john) - Jane Doe (@jane) - attributes: - diff_mode: - description: Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode - support: partial - details: Not all modules used support this version_added: 1.2.0 notes: - This is a role. diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index f91ad837e8a..427ba8d8a3f 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -229,7 +229,6 @@ test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:a test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-date-not-permitted # required to verify plugin against core test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-unnecessary-collection-name # required to verify plugin against core test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-collection-name-not-permitted # required to verify plugin against core -lib/ansible/cli/doc.py pylint:ansible-deprecated-version # TODO: 2.20 lib/ansible/galaxy/api.py pylint:ansible-deprecated-version # TODO: 2.20 lib/ansible/utils/encrypt.py pylint:ansible-deprecated-version # TODO: 2.20 lib/ansible/utils/ssh_functions.py pylint:ansible-deprecated-version # TODO: 2.20