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).
Suggested Answer: A, E
Get Premium 701-100 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
35 comments · newest first
SH
Sherell
10 months ago
E looks weird, not sure about that one.
HE
Hershel
10 months ago
Surprised that A is even an option, that's not valid!
LE
Lenna
10 months ago
Definitely C and D!
CH
Charolette
11 months ago
I think B is wrong, it doesn't follow the syntax.
LE
Leatha
11 months ago
C and D are the go-to for sure!
NG
Ngoc
11 months ago
I practiced a question like this, and I believe both myapp.option1 and myapp['option1'] are the right ways to reference the variable.
MA
Margret
11 months ago
I think myapp(option1) is definitely incorrect, but I can't recall if myapp{{option1}} is valid or not.
DE
Detra
12 months ago
I'm not entirely sure, but I feel like myapp['option1'] might also work since I've seen similar syntax in other examples.
CL
Clare
12 months ago
I remember that we can use dot notation to access variables in Ansible, so I think myapp.option1 could be one of the answers.
FR
Francine
1 year ago
This is a good test of my Ansible knowledge. I'm pretty confident I can narrow down the correct answers, but I'll want to review the variable access syntax to be sure.
MA
Mari
1 year ago
I'm a little confused by the different options here. I'll need to double-check the Ansible variable syntax to make sure I understand the differences between these choices.
AL
Alyce
1 year ago
Okay, let me think this through step-by-step. The variable is defined in a YAML file, so I'll need to use dot notation or bracket notation to access it. I'm guessing the correct answers are C and D.
SK
Skye
1 year ago
Hmm, I'm a bit unsure about the syntax for accessing Ansible variables. I'll need to review the documentation to make sure I get this right.
FR
Francesco
1 year ago
This looks like a straightforward Ansible variable access question. I'm pretty confident I can figure this out.
LU
Lucille
1 year ago
Ah, the old Ansible variable question. C) myapp['option1'] and D) myapp.option1 are the clear winners here. Although, I'm pretty sure the designers of Ansible had a sense of humor when they named it. Maybe they were big fans of the Dune series.
LI
Linsey
1 year ago
C) myapp['option1'] and D) myapp.option1 are the way to go. Although, I'm still trying to figure out why they call it 'Ansible' - must be some sort of inside joke.
ES
Esteban
1 year ago
I agree, the naming of 'Ansible' is quite interesting. It must have a special meaning behind it.
ES
Estrella
1 year ago
D) myapp.option1 is also a valid way to reference the defined variable.
EL
Eleni
1 year ago
C) myapp['option1'] is the correct way to reference the defined variable.
DO
Dominga
1 year ago
Yeah, I agree with C) myapp['option1'] and D) myapp.option1. Gotta love that Ansible dot and bracket notation!
DU
Dusti
1 year ago
The dot and bracket notation in Ansible makes it easy to work with variables.
ME
Melvin
1 year ago
Yes, D) myapp.option1 is also a valid way to access the defined variable.
GE
Gerald
1 year ago
I think C) myapp['option1'] is the correct way to reference the variable.
RA
Rashad
2 years ago
I'm pretty sure the correct answers are C) myapp['option1'] and D) myapp.option1. Ansible variables are accessed using those two methods, right?
SH
Shakira
1 year ago
Thanks for confirming. It's important to know how to properly access variables in Ansible for smooth automation processes.
LI
Lindsey
1 year ago
Yes, that's right. Those are the correct ways to reference the defined variable in an Ansible variable file.
IS
Isidra
1 year ago
I think you're correct. Ansible variables can be accessed using myapp['option1'] and myapp.option1.
AN
Anna
2 years ago
Hmm, let me think. I'll go with C) myapp['option1'] and D) myapp.option1. Ansible uses dot notation and bracket notation to access variables, so those two options seem like the winners to me.
RO
Rozella
1 year ago
Absolutely, C) myapp['option1'] and D) myapp.option1 are the way to go when referencing variables in Ansible.
DO
Donte
1 year ago
Great, I'm glad we're on the same page. Those two options are the ones that align with how Ansible handles variable references.
RI
Ricarda
1 year ago
Yes, Ansible allows you to access variables using dot notation or bracket notation, so C) and D) are the correct choices.
FL
Florinda
1 year ago
I think you're right. C) myapp['option1'] and D) myapp.option1 are the correct ways to reference the defined variable.
TA
Tambra
2 years ago
I'm not sure about E) myapp{{option1}}, it looks like it might have a syntax error. I would go with C) and D) as well.
AV
Avery
2 years ago
I agree with Lovetta, those options make sense because they follow the correct syntax for referencing variables in Ansible.
LO
Lovetta
2 years ago
I think the correct answers are C) myapp['option1'] and D) myapp.option1