diff --git a/changelogs/fragments/57020-facts-info-rename.yaml b/changelogs/fragments/57020-facts-info-rename.yaml new file mode 100644 index 0000000000..255edc52bc --- /dev/null +++ b/changelogs/fragments/57020-facts-info-rename.yaml @@ -0,0 +1,4 @@ +minor_changes: +- The ``jenkins_job_facts`` module has been renamed to ``jenkins_job_info``. +- The ``intersight_facts`` module has been renamed to ``intersight_info``. +- The ``github_webhook_facts`` module has been renamed to ``github_webhook_info``. diff --git a/docs/docsite/rst/porting_guides/porting_guide_2.9.rst b/docs/docsite/rst/porting_guides/porting_guide_2.9.rst index 96f0c88c77..d76e3c0579 100644 --- a/docs/docsite/rst/porting_guides/porting_guide_2.9.rst +++ b/docs/docsite/rst/porting_guides/porting_guide_2.9.rst @@ -70,8 +70,11 @@ Noteworthy module changes * `vmware_datastore_cluster ` accepts `folder` parameter to place datastore cluster in user defined folder. This option makes `datacenter` as an optional parameter. * The ``python_requirements_facts`` module was renamed to :ref:`python_requirements_info `. +* The ``jenkins_job_facts`` module was renamed to :ref:`jenkins_job_info `. +* The ``intersight_facts`` module was renamed to :ref:`intersight_info `. * The ``zabbix_group_facts`` module was renamed to :ref:`zabbix_group_info `. * The ``zabbix_host_facts`` module was renamed to :ref:`zabbix_host_info `. +* The ``github_webhook_facts`` module was renamed to :ref:`github_webhook_info `. * The ``k8s_facts`` module was renamed to :ref:`k8s_info `. * The ``bigip_device_facts`` module was renamed to :ref:`bigip_device_info `. * The ``bigiq_device_facts`` module was renamed to :ref:`bigiq_device_info `. diff --git a/lib/ansible/modules/remote_management/intersight/_intersight_facts.py b/lib/ansible/modules/remote_management/intersight/_intersight_facts.py new file mode 120000 index 0000000000..507ccd1c01 --- /dev/null +++ b/lib/ansible/modules/remote_management/intersight/_intersight_facts.py @@ -0,0 +1 @@ +intersight_info.py \ No newline at end of file diff --git a/lib/ansible/modules/remote_management/intersight/intersight_facts.py b/lib/ansible/modules/remote_management/intersight/intersight_info.py similarity index 83% rename from lib/ansible/modules/remote_management/intersight/intersight_facts.py rename to lib/ansible/modules/remote_management/intersight/intersight_info.py index 3704c85875..d4e215d8f3 100644 --- a/lib/ansible/modules/remote_management/intersight/intersight_facts.py +++ b/lib/ansible/modules/remote_management/intersight/intersight_info.py @@ -12,15 +12,16 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = r''' --- -module: intersight_facts -short_description: Gather facts about Intersight +module: intersight_info +short_description: Gather information about Intersight description: -- Gathers facts about servers in L(Cisco Intersight,https://intersight.com). +- Gathers information about servers in L(Cisco Intersight,https://intersight.com). +- This module was called C(intersight_facts) before Ansible 2.9. The usage did not change. extends_documentation_fragment: intersight options: server_names: description: - - Server names to retrieve facts from. + - Server names to retrieve information from. - An empty list will return all servers. type: list required: yes @@ -31,8 +32,8 @@ version_added: '2.8' ''' EXAMPLES = r''' -- name: Get facts for all servers - intersight_facts: +- name: Get info for all servers + intersight_info: api_private_key: ~/Downloads/SecretKey.txt api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650 server_names: @@ -41,8 +42,8 @@ EXAMPLES = r''' loop: "{{ intersight_servers }}" when: intersight_servers is defined -- name: Get facts for servers by name - intersight_facts: +- name: Get info for servers by name + intersight_info: api_private_key: ~/Downloads/SecretKey.txt api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650 server_names: @@ -103,6 +104,8 @@ def main(): argument_spec, supports_check_mode=True, ) + if module._name == 'intersight_facts': + module.deprecate("The 'intersight_facts' module has been renamed to 'intersight_info'", version='2.13') intersight = IntersightModule(module) diff --git a/lib/ansible/modules/source_control/_github_hooks.py b/lib/ansible/modules/source_control/_github_hooks.py index 4116df8797..0a92ee124a 100644 --- a/lib/ansible/modules/source_control/_github_hooks.py +++ b/lib/ansible/modules/source_control/_github_hooks.py @@ -20,7 +20,7 @@ short_description: Manages GitHub service hooks. deprecated: removed_in: "2.12" why: Replaced by more granular modules - alternative: Use M(github_webhook) and M(github_webhook_facts) instead. + alternative: Use M(github_webhook) and M(github_webhook_info) instead. description: - Adds service hooks and removes service hooks that have an error status. version_added: "1.4" diff --git a/lib/ansible/modules/source_control/_github_webhook_facts.py b/lib/ansible/modules/source_control/_github_webhook_facts.py new file mode 120000 index 0000000000..1e4cc94d4d --- /dev/null +++ b/lib/ansible/modules/source_control/_github_webhook_facts.py @@ -0,0 +1 @@ +github_webhook_info.py \ No newline at end of file diff --git a/lib/ansible/modules/source_control/github_webhook_facts.py b/lib/ansible/modules/source_control/github_webhook_info.py similarity index 93% rename from lib/ansible/modules/source_control/github_webhook_facts.py rename to lib/ansible/modules/source_control/github_webhook_info.py index 920d349062..83da87a051 100644 --- a/lib/ansible/modules/source_control/github_webhook_facts.py +++ b/lib/ansible/modules/source_control/github_webhook_info.py @@ -14,11 +14,12 @@ ANSIBLE_METADATA = { DOCUMENTATION = ''' --- -module: github_webhook_facts +module: github_webhook_info short_description: Query information about GitHub webhooks version_added: "2.8" description: - "Query information about GitHub webhooks" + - This module was called C(github_webhook_facts) before Ansible 2.9. The usage did not change. requirements: - "PyGithub >= 1.3.5" options: @@ -52,14 +53,14 @@ author: EXAMPLES = ''' - name: list hooks for a repository (password auth) - github_webhook_facts: + github_webhook_info: repository: ansible/ansible user: "{{ github_user }}" password: "{{ github_password }}" register: ansible_webhooks - name: list hooks for a repository on GitHub Enterprise (token auth) - github_webhook_facts: + github_webhook_info: repository: myorg/myrepo user: "{{ github_user }}" token: "{{ github_user_api_token }}" @@ -126,6 +127,8 @@ def main(): mutually_exclusive=(('password', 'token'), ), required_one_of=(("password", "token"), ), supports_check_mode=True) + if module._name == 'github_webhook_facts': + module.deprecate("The 'github_webhook_facts' module has been renamed to 'github_webhook_info'", version='2.13') if not HAS_GITHUB: module.fail_json(msg=missing_required_lib('PyGithub'), diff --git a/lib/ansible/modules/web_infrastructure/_jenkins_job_facts.py b/lib/ansible/modules/web_infrastructure/_jenkins_job_facts.py new file mode 120000 index 0000000000..7a78b2faee --- /dev/null +++ b/lib/ansible/modules/web_infrastructure/_jenkins_job_facts.py @@ -0,0 +1 @@ +jenkins_job_info.py \ No newline at end of file diff --git a/lib/ansible/modules/web_infrastructure/jenkins_job_facts.py b/lib/ansible/modules/web_infrastructure/jenkins_job_info.py similarity index 82% rename from lib/ansible/modules/web_infrastructure/jenkins_job_facts.py rename to lib/ansible/modules/web_infrastructure/jenkins_job_info.py index 390709582b..ac659c2008 100644 --- a/lib/ansible/modules/web_infrastructure/jenkins_job_facts.py +++ b/lib/ansible/modules/web_infrastructure/jenkins_job_info.py @@ -15,20 +15,21 @@ ANSIBLE_METADATA = { DOCUMENTATION = ''' --- -module: jenkins_job_facts -short_description: Get facts about Jenkins jobs +module: jenkins_job_info +short_description: Get information about Jenkins jobs version_added: "2.5" description: - - This module can be used to query the facts about which Jenkins jobs which already exists. + - This module can be used to query information about which Jenkins jobs which already exists. + - This module was called C(jenkins_job_info) before Ansible 2.9. The usage did not change. requirements: - "python-jenkins >= 0.4.12" options: name: description: - - Exact name of the Jenkins job to fetch facts about. + - Exact name of the Jenkins job to fetch information about. glob: description: - - A shell glob of Jenkins job names to fetch facts about. + - A shell glob of Jenkins job names to fetch information about. color: description: - Only fetch jobs with the given status color. @@ -60,60 +61,60 @@ author: EXAMPLES = ''' # Get all Jenkins jobs using basic auth -- jenkins_job_facts: +- jenkins_job_info: user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info # Get all Jenkins jobs using the token -- jenkins_job_facts: +- jenkins_job_info: user: admin token: abcdefghijklmnop - register: my_jenkins_job_facts + register: my_jenkins_job_info -# Get facts about a single job using basic auth -- jenkins_job_facts: +# Get info about a single job using basic auth +- jenkins_job_info: name: some-job-name user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info -# Get facts about a single job in a folder using basic auth -- jenkins_job_facts: +# Get info about a single job in a folder using basic auth +- jenkins_job_info: name: some-folder-name/some-job-name user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info -# Get facts about jobs matching a shell glob using basic auth -- jenkins_job_facts: +# Get info about jobs matching a shell glob using basic auth +- jenkins_job_info: glob: some-job-* user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info -# Get facts about all failing jobs using basic auth -- jenkins_job_facts: +# Get info about all failing jobs using basic auth +- jenkins_job_info: color: red user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info -# Get facts about passing jobs matching a shell glob using basic auth -- jenkins_job_facts: +# Get info about passing jobs matching a shell glob using basic auth +- jenkins_job_info: name: some-job-* color: blue user: admin password: hunter2 - register: my_jenkins_job_facts + register: my_jenkins_job_info -- name: Get the facts from custom URL with token and validate_certs=False - jenkins_job_facts: +- name: Get the info from custom URL with token and validate_certs=False + jenkins_job_info: user: admin token: 126df5c60d66c66e3b75b11104a16a8a url: https://jenkins.example.com validate_certs: False - register: my_jenkins_job_facts + register: my_jenkins_job_info ''' RETURN = ''' @@ -237,6 +238,8 @@ def main(): ], supports_check_mode=True, ) + if module._name == 'jenkins_job_facts': + module.deprecate("The 'jenkins_job_facts' module has been renamed to 'jenkins_job_info'", version='2.13') test_dependencies(module) jobs = list() diff --git a/test/integration/targets/intersight_facts/aliases b/test/integration/targets/intersight_info/aliases similarity index 100% rename from test/integration/targets/intersight_facts/aliases rename to test/integration/targets/intersight_info/aliases diff --git a/test/integration/targets/intersight_facts/tasks/main.yml b/test/integration/targets/intersight_info/tasks/main.yml similarity index 80% rename from test/integration/targets/intersight_facts/tasks/main.yml rename to test/integration/targets/intersight_info/tasks/main.yml index d12d3aa12c..0aa73be487 100644 --- a/test/integration/targets/intersight_facts/tasks/main.yml +++ b/test/integration/targets/intersight_info/tasks/main.yml @@ -9,27 +9,27 @@ api_private_key: "{{ api_private_key | default('~/Downloads/SSOSecretKey.txt') }}" api_key_id: "{{ api_key_id | default('596cc79e5d91b400010d15ad/596cc7945d91b400010d154e/5b6275df3437357030a7795f') }}" -- name: Get facts for all servers - intersight_facts: +- name: Get infos for all servers + intersight_info: <<: *api_info server_names: register: result -- name: Verify facts does not report a change +- name: Verify info does not report a change assert: that: - result.changed == false - "'Name' in result.intersight_servers[0]" - "'Moid' in result.intersight_servers[0]" -- name: Get facts for servers by name - intersight_facts: +- name: Get info for servers by name + intersight_info: <<: *api_info server_names: - CC7UCS-13-1-1 register: result2 -- name: Verify facts does not report a change +- name: Verify info does not report a change assert: that: - result2.changed == false