Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/terraform/tasks/complex_variables.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Create terraform project directory (complex variables)
7 ansible.builtin.file:
8 path: "{{ terraform_project_dir }}/complex_vars"
9 state: directory
10 mode: "0755"
11
12 - name: copy terraform files to work space
13 ansible.builtin.copy:
14 src: "complex_variables/{{ item }}"
15 dest: "{{ terraform_project_dir }}/complex_vars/{{ item }}"
16 with_items:
17 - main.tf
18 - variables.tf
19
20 # This task would test the various complex variable structures of the with the
21 # terraform null_resource
22 - name: test complex variables
23 community.general.terraform:
24 project_path: "{{ terraform_project_dir }}/complex_vars"
25 binary_path: "{{ terraform_binary_path }}"
26 force_init: true
27 complex_vars: true
28 variables:
29 dictionaries:
30 name: "kosala"
31 age: 99
32 list_of_strings:
33 - "kosala"
34 - 'cli specials"&$%@#*!(){}[]:"" \\'
35 - "xxx"
36 - "zzz"
37 list_of_objects:
38 - name: "kosala"
39 age: 99
40 - name: 'cli specials"&$%@#*!(){}[]:"" \\'
41 age: 0.1
42 - name: "zzz"
43 age: 9.789
44 - name: "lll"
45 age: 1000
46 boolean: true
47 string_type: 'cli specials"&$%@#*!(){}[]:"" \\'
48 multiline_string: |
49 one
50 two
51 list_of_lists:
52 - [1]
53 - [11, 12, 13]
54 - [2]
55 - [3]
56 state: present
57 register: terraform_init_result
58
59 - assert:
60 that: terraform_init_result is not failed