Skip to content

Make /per-rule Ansible playbooks support multi-line strings#624

Merged
matusmarhefka merged 1 commit into
mainfrom
per_rule_multiline
May 21, 2026
Merged

Make /per-rule Ansible playbooks support multi-line strings#624
matusmarhefka merged 1 commit into
mainfrom
per_rule_multiline

Conversation

@comps

@comps comps commented May 21, 2026

Copy link
Copy Markdown
Contributor

This hit a real issue with a source (not yet modified by test) built playbook, which specified

- name: Modify the System Login Banner
  hosts: '@@HOSTS@@'
  become: true
  vars:
    login_banner_contents: Authorized users only. All activity may be monitored and
      reported.
  tags:
  - CCE-83557-9
  - DISA-STIG-RHEL-09-211020

That's valid YAML, and so would be

login_banner_contents: >
  Authorized users only. All activity may be monitored and
  reported.

or any variation on it.

The key here is that follow-up lines always have indent greater than the key (since these always contain strings, never lists).

This small addition should remove the original value fully, I hope.

@matusmarhefka matusmarhefka merged commit 2716f5a into main May 21, 2026
4 checks passed
@matusmarhefka matusmarhefka deleted the per_rule_multiline branch May 21, 2026 07:50
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