-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Module interfaces_file ignore option line not starting with a space #6120
Comments
Files identified in the description: If these files are incorrect, please update the |
hryamzik
added a commit
to hryamzik/community.general
that referenced
this issue
Mar 2, 2023
felixfontein
added a commit
that referenced
this issue
Mar 9, 2023
* interfaces_file: added test case for #6120 * interfaces_file: reverted code to #fafabed * interfaces_file: added changelog fragment * interfaces_file: added missing licenses * interfaces_file: improved test coverage * interfaces_file: fixed retrieving option values * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * interfaces_file: spacing fix --------- Co-authored-by: Felix Fontein <felix@fontein.de>
patchback bot
pushed a commit
that referenced
this issue
Mar 9, 2023
* interfaces_file: added test case for #6120 * interfaces_file: reverted code to #fafabed * interfaces_file: added changelog fragment * interfaces_file: added missing licenses * interfaces_file: improved test coverage * interfaces_file: fixed retrieving option values * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * interfaces_file: spacing fix --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit abcba9d)
felixfontein
pushed a commit
to felixfontein/community.general
that referenced
this issue
Mar 9, 2023
* interfaces_file: added test case for ansible-collections#6120 * interfaces_file: reverted code to #fafabed * interfaces_file: added changelog fragment * interfaces_file: added missing licenses * interfaces_file: improved test coverage * interfaces_file: fixed retrieving option values * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * interfaces_file: spacing fix --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit abcba9d)
felixfontein
pushed a commit
that referenced
this issue
Mar 9, 2023
) Interfaces file spaces fix (#6131) * interfaces_file: added test case for #6120 * interfaces_file: reverted code to #fafabed * interfaces_file: added changelog fragment * interfaces_file: added missing licenses * interfaces_file: improved test coverage * interfaces_file: fixed retrieving option values * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * interfaces_file: spacing fix --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit abcba9d) Co-authored-by: Roman Belyakovsky <roman.beliakovskii@smartly.io>
felixfontein
added a commit
that referenced
this issue
Mar 14, 2023
Interfaces file spaces fix (#6131) * interfaces_file: added test case for #6120 * interfaces_file: reverted code to #fafabed * interfaces_file: added changelog fragment * interfaces_file: added missing licenses * interfaces_file: improved test coverage * interfaces_file: fixed retrieving option values * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py Co-authored-by: Felix Fontein <felix@fontein.de> * interfaces_file: spacing fix --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit abcba9d) Co-authored-by: Roman Belyakovsky <roman.beliakovskii@smartly.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When the module interfaces_file look for options in the interfaces file, it use the following regexp (https://github.com/ansible-collections/community.general/blob/main/plugins/modules/interfaces_file.py#L168):
It required each option line to start with at least one space character (
^\s+
). The module ignore option lines not starting with space. Modifying this option results in duplicate lines.To fix this issue, replace
+
by*
:Issue Type
Bug Report
Component Name
interfaces_file
Ansible Version
Community.general Version
Configuration
No response
OS / Environment
No response
Steps to Reproduce
The task:
My interfaces file before:
Expected Results
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: