100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
RHCE Exam Questions with Correct Answers New update $12.49   Add to cart

Exam (elaborations)

RHCE Exam Questions with Correct Answers New update

 7 views  0 purchase
  • Course
  • RHCE
  • Institution
  • RHCE

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

[Show more]

Preview 2 out of 5  pages

  • August 18, 2024
  • 5
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • rhce
  • RHCE
  • RHCE
avatar-seller
Scholarsstudyguide
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Scholarsstudyguide. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78998 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.49
  • (0)
  Add to cart