summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/config/validation.yml
blob: 1c81e662b6ebe9bb952dd409028b31c9ac9f054e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- hosts: localhost
  gather_facts: false
  tasks:
    - name: does nothing but an empty assign, should fail only if lookup gets invalid options
      set_fact: whatever={{ lookup('bogus', 1, test_list=['Dan', 'Manuela']) }}

    - name: now pass invalid option and fail!
      set_fact: whatever={{ lookup('bogus', 1, test_list=['Dan', 'Manuela', 'Yoko']) }}
      register: bad_input
      ignore_errors: true

    - name: ensure it fails as expected
      assert:
        that:
          - bad_input is failed
          - '"Invalid value " in bad_input.msg'
          - '"valid values are:" in bad_input.msg'