Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #6352/0eb33c28 backport][stable-6] Add support env variables for nmap inventory plugin #6394

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Apr 22, 2023

This is a backport of PR #6352 as merged into main (0eb33c2).

SUMMARY

Added environment variables for configure address and exclude for nmap dynamic inventory plugin

Fixes #6351

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

community.general.nmap

ADDITIONAL INFORMATION
printenv ANSIBLE_NMAP_EXCLUDE ANSIBLE_NMAP_ADDRESS
---
plugin: community.general.nmap
strict: false
ports: false
$ ansible-playbook -i inventory.yaml playbook.yaml
[WARNING]:  * Failed to parse /home/ev3k/INBOX/ansible/inventory.yaml with auto plugin: No setting was provided for required configuration plugin_type: inventory plugin:
ansible_collections.community.general.plugins.inventory.nmap setting: address
[WARNING]:  * Failed to parse /home/ev3k/INBOX/ansible/inventory.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]:  * Failed to parse /home/ev3k/INBOX/ansible/inventory.yaml with ini plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a YAML file.
[WARNING]: Unable to parse /home/ev3k/INBOX/ansible/inventory.yaml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Network Getting Started First Playbook] ****************************************************************************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************************************************************************************************
export ANSIBLE_NMAP_ADDRESS=203.0.113.0/29
$ ansible-playbook -i inventory.yaml playbook.yaml

PLAY [Network Getting Started First Playbook] ****************************************************************************************************************************************************

TASK [test] **************************************************************************************************************************************************************************************
ok: [nb] => {
    "msg": "nb"
}
ok: [203.0.113.4] => {
    "msg": "203.0.113.4"
}
ok: [203.0.113.2] => {
    "msg": "203.0.113.2"
}

PLAY RECAP ***************************************************************************************************************************************************************************************
203.0.113.2                : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
203.0.113.4                : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
nb                                : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
export ANSIBLE_NMAP_EXCLUDE=203.0.113.1,203.0.113.2
$ ansible-playbook -i inventory.yaml playbook.yaml

PLAY [Network Getting Started First Playbook] ****************************************************************************************************************************************************

TASK [test] **************************************************************************************************************************************************************************************
ok: [203.0.113.4] => {
    "msg": "203.0.113.4"
}

PLAY RECAP ***************************************************************************************************************************************************************************************
203.0.113.4                : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

* Add support env variables for nmap inventory plugin

* Add  changelogs/fragments file

* Rename support-env-variables-to-nmap-dynamic-inventoiry to 6351-support-env-variables-to-nmap-dynamic-inventoiry

* Add extension for changelog file

* Fix #6352 (comment)

Co-authored-by: Felix Fontein <[email protected]>

* Fix #6352 (comment)

Co-authored-by: Felix Fontein <[email protected]>

* Fix #6352 (comment)

Co-authored-by: Felix Fontein <[email protected]>

* Fix #6352 (comment)

* Fix linter

* Fix #6352 (comment)

* Fix changelog fragment.

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 0eb33c2)
@ansibullbot ansibullbot added backport feature This issue/PR relates to a feature request inventory inventory plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Apr 22, 2023
@felixfontein felixfontein merged commit 46a83df into stable-6 Apr 23, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-6/0eb33c283929f299bd7acef730a77552515a966e/pr-6352 branch April 23, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request inventory inventory plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants