"Fossies" - the Fresh Open Source Software Archive

Member "ansible-6.1.0/ansible_collections/community/general/tests/integration/targets/ini_file/tasks/tests/00-basic.yml" (12 Jul 2022, 929 Bytes) of package /linux/misc/ansible-6.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ---
    2 ## basiscs
    3 
    4 - name: test-basic 1 - specify both "value" and "values" and fail
    5   ini_file:
    6     path: "{{ output_file }}"
    7     section: drinks
    8     option: fav
    9     value: lemonade
   10     values:
   11       - coke
   12       - sprite
   13   register: result_basic_1
   14   ignore_errors: true
   15 
   16 - name: test-basic 1 - verify error message
   17   assert:
   18     that:
   19       - result_basic_1 is not changed
   20       - result_basic_1 is failed
   21       - "result_basic_1.msg == 'parameters are mutually exclusive: value|values'"
   22 
   23 
   24 - name: test-basic 2 - set "create=no" on non-existing file and fail
   25   ini_file:
   26     path: "{{ non_existing_file }}"
   27     section: food
   28     create: false
   29     value: banana
   30   register: result_basic_2
   31   ignore_errors: true
   32 
   33 - name: test-basic 2 - verify error message
   34   assert:
   35     that:
   36       - result_basic_2 is not changed
   37       - result_basic_2 is failed
   38       - result_basic_2.msg == "Destination {{ non_existing_file }} does not exist!"