exam questions

Exam 701-100 All Questions

View all questions & answers for the 701-100 exam

Exam 701-100 topic 1 question 19 discussion

Actual exam question from LPI's 701-100
Question #: 19
Topic #: 1
[All 701-100 Questions]

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).

  • A. myapp(option1);
  • B. option1@myapp
  • C. myapp["˜option1']
  • D. myapp.option1
  • E. myapp{{option1}}
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hmagroun
Highly Voted 2 years, 3 months ago
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 "
upvoted 8 times
...
hector1978
Highly Voted 2 years, 5 months ago
This answer is wrong: The correct answer is C and D
upvoted 6 times
...
[Removed]
Most Recent 4 months, 2 weeks ago
Selected Answer: CD
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
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago