100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

RHCE Exam Questions with Correct Answers New update

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
18-08-2024
Written in
2024/2025

RHCE Exam Questions with Correct Answers New update How to syntax check a playbook - Answer-ansible-playbook --syntax-check How to dry run a playbook - Answer-ansible-playbook -C Keywords for controlling ansible user, as well as escalating privilege - Answer-remote_user: user become: yes/no become: true/false become_method: sudo Sample output for a module - Answer-ansible-doc -s module_name Defining variables - Answer-vars: name1: value1 name2: value2 vars_files: - vars/ Using (referencing) a variable in a playbook - Answer-{{ var_name }} (use quotes if starting a value) Defining group variables and host variables - Answer-group_vars/group_name, host_vars/host_name name:value (group_name and host_name can be a file or a directory) Overriding variables - Answer-ansible-playbook -e "name=value" Referencing arrays - A_name users['bjones']['first_name'] How to save the output from a module to a variable - Answer-register: var_name How to output/display variable - Answer-- debug: var=var_name Creating encrypted ansible file - Answer-ansible-vault create ansible-vault create --vault-password-file=vault-pass

Show more Read less
Institution
RHCE
Course
RHCE









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
RHCE
Course
RHCE

Document information

Uploaded on
August 18, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

  • rhce

Content preview

RHCE Exam Questions with Correct
Answers New update
How to syntax check a playbook - Answer-ansible-playbook --syntax-check
playbook.yml

How to dry run a playbook - Answer-ansible-playbook -C playbook.yml

Keywords for controlling ansible user, as well as escalating privilege - Answer-
remote_user: user
become: yes/no
become: true/false
become_method: sudo

Sample output for a module - Answer-ansible-doc -s module_name

Defining variables - Answer-vars:
name1: value1
name2: value2
vars_files:
- vars/users.yml

Using (referencing) a variable in a playbook - Answer-{{ var_name }} (use quotes if
starting a value)

Defining group variables and host variables - Answer-group_vars/group_name,
host_vars/host_name

name:value

(group_name and host_name can be a file or a directory)

Overriding variables - Answer-ansible-playbook main.yml -e "name=value"

Referencing arrays - Answer-users.bjones.first_name
users['bjones']['first_name']

How to save the output from a module to a variable - Answer-register: var_name

How to output/display variable - Answer-- debug: var=var_name

Creating encrypted ansible file - Answer-ansible-vault create secret.yml
ansible-vault create --vault-password-file=vault-pass secret.yml

, (use vault ID's if creating multiple vault passwords in a playbook)

Viewing encrypted ansible file - Answer-ansible-vault view secret1.yml

Encrypt existing file - Answer-ansible-vault encrypt secret.yml

Run playbook with encrypted files - Answer-ansible-playbook --vault-id @prompt
playbook.yml
ansible-playbook --vault-password-file=vault-pw-file playbook.yml

Important Ansible facts - Answer-ansible_facts['hostname']
ansible_facts['fqdn']
ansible_facts['default_ipv4']['address']
ansible_facts['distribution']
ansible_facts['os_family']

Default location for custom facts - Answer-/etc/ansible/facts.d/*.fact

Most useful/notable magic variables - Answer-hostvars
group_names
groups
inventory_hostname

How to get/display ansible facts - Answer-ansible host -m setup

Multi-line values (conditionals, strings, etc) - Answer-whatever: >
content on the next line here
and here
etc etc

Keyword for looping - Answer-loop: list (can be variable)

Keyword for conditionals - Answer-when: condition
OR
when:
- condition
- condition


Ansible configuration groups - Answer-[defaults], [privilege_escalation]

Various configurations for privilege escalation in ansible.cfg - Answer-become,
become_method, become_user, become_ask_pass

Syntax for running an ansible ad hoc command - Answer-ansible host-pattern -m
module -a ansible-arguments

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Scholarsstudyguide nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
778
Member since
3 year
Number of followers
475
Documents
15020
Last sold
1 day ago
NURSING

Here you will find everything you need in nursing Assignments, EXAMS AND TESTBANKS. For students who want to see results twice as fast. I strive for my content to be of the highest quality. Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied.

3.9

163 reviews

5
87
4
21
3
25
2
6
1
24

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions