ansible/test/integration/targets/blockinfile/tasks/validate.yml
Sam Doran c422bc64dc
[stable-2.10] blockinfile - properly insert block when no trailing new line exists (#72350) (#72360)
(cherry picked from commit c51438312a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-12-07 17:32:56 -06:00

28 lines
577 B
YAML

- name: EXPECTED FAILURE test improper validate
blockinfile:
path: "{{ output_dir }}/validate.txt"
block: |
line1
line2
create: yes
validate: grep
ignore_errors: yes
- name: EXPECTED FAILURE test failure to validate
blockinfile:
path: "{{ output_dir }}/validate.txt"
block: |
line1
line2
create: yes
validate: grep line47 %s
ignore_errors: yes
- name: Test proper validate
blockinfile:
path: "{{ output_dir }}/validate.txt"
block: |
line1
line2
create: yes
validate: grep line1 %s