An Ansible variable file contains the following content: myapp: option1: one Which of the following strings can be used to reference the defined variable? (Choose two correct answers).
The correct answer is C and D
see: https://docs.ansible.com/ansible/2.5/user_guide/playbooks_variables.html#what-makes-a-valid-variable-name
"...
YAML also supports dictionaries which map keys to values. For instance:
foo:
field1: one
field2: two
You can then reference a specific field in the dictionary using either bracket notation or dot notation:
foo['field1']
foo.field1
"
Ansible 2.5 documentation:
YAML also supports dictionaries which map keys to values. For instance:
foo:
field1: one
field2: two
You can then reference a specific field in the dictionary using either bracket notation or dot notation:
foo['field1']
foo.field1
Ansible 5 documentation:
Simple variables:
remote_install_path: /opt/my_app_config
...
ansible.builtin.template:
src: foo.cfg.j2
dest: '{{ remote_install_path }}/foo.cfg'
Referencing list variables:
region: "{{ region[0] }}"
Dictionary variables:
foo['field1']
foo.field1
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
hmagroun
Highly Voted 2 years, 3 months agohector1978
Highly Voted 2 years, 5 months ago[Removed]
Most Recent 4 months, 2 weeks ago