Skip to content

feat: Argument spec implementation for sudo role - #143

Open
DonatSzabo wants to merge 2 commits into
linux-system-roles:mainfrom
DonatSzabo:argument_spec_implementation-dszabo
Open

feat: Argument spec implementation for sudo role#143
DonatSzabo wants to merge 2 commits into
linux-system-roles:mainfrom
DonatSzabo:argument_spec_implementation-dszabo

Conversation

@DonatSzabo

Copy link
Copy Markdown

Enhancement: Added argument spec and assert role spec validation to the sudo role. Also wrote tests for it found in tests/tests_invalid_input.

Reason: Because it is a good addition to the linux-system-roles project.

Result: Successfully added it and prepared tests for it. I used AI during this implementation.

Issue Tracker Tickets (Jira or BZ if any): linux-system-roles/postfix#206 https://redhat.atlassian.net/browse/RHELMISC-16008

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 248400fe-2330-4a70-8a24-151efa2f807b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@e5f945b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #143   +/-   ##
=======================================
  Coverage        ?   61.39%           
=======================================
  Files           ?        2           
  Lines           ?      487           
  Branches        ?        0           
=======================================
  Hits            ?      299           
  Misses          ?      188           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread tasks/assert_role_vars.yml Outdated
sudo_sudoers_files defaults items must be strings or
mappings, got {{ item | type_debug }}
loop: "{{ sudo_sudoers_files | selectattr('defaults', 'defined')
| map(attribute='defaults') | flatten }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| map(attribute='defaults') | flatten }}"
| map(attribute='defaults') | flatten | list }}"

for ansible 2.9 compatibility always add | list to the end of filter pipelines that produce a list

Comment thread tasks/assert_role_vars.yml Outdated
list of strings, got {{ item.selinux_role | type_debug }}
loop: "{{ sudo_sudoers_files
| selectattr('user_specifications', 'defined')
| map(attribute='user_specifications') | flatten }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Comment thread tasks/assert_role_vars.yml Outdated
list of strings, got {{ item.selinux_type | type_debug }}
loop: "{{ sudo_sudoers_files
| selectattr('user_specifications', 'defined')
| map(attribute='user_specifications') | flatten }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@richm

richm commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

[citest]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants