RHCE Exam Study Guide with Complete Solutions
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
Command for getting info on a module - Answer✔️✔️-ansible-doc
<module>
ansible-doc -l (lists all modules)
VIM formatting for Ansible - Answer✔️✔️-autocmd FileType yaml setlocal
ai ts=2 sw=2 et
Basic/common keywords at the top of a play - Answer✔️✔️-name:
hosts:
tasks:
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
1
, ©SOPHIABENNET@2024/2025 Tuesday, August 20, 2024 10:21 AM
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)
2