Font size
WorksheetsConfiguration Management using Ansible - 2
Total questions: 10
Worksheet time: 6mins
How can you encrypt a file using Ansible Vault?
ansible-vault encrypt <filename>
ansible encrypt-vault <filename>
ansible-vault encrypt –file <filename>
ansible-encrypt encrypt <filename>
What is Ansible Galaxy?
Store Ansible Playbooks
It acts as a community and helps store Ansible Modules
It acts as a community and helps store Ansible Roles and Collection
Store sensitive data via ansible vault
What is the purpose of the keyword "become" in an Ansible playbook?
To switch to a different playbook
To switch to a different (typically privileged) user on target nodes
To switch to a different (typically privileged) user on controller
To convert ansible modules into a role
Which of the following parameter helps add / modify permissions for a file in Ansible "file" module?
mode
group
owner
state
present
I want to make sure that my nginx service is in running state on my target nodes. How can i ensure it?
By using the “action” parameter with the value “start”
By providing the name of the service as a parameter to the module
By using the “service” parameter with the value “start”
By using the “state” parameter with the value “started”
What is the purpose of the Ansible module “setup”?
To set up a new target system with the necessary software and configurations
To gather facts about a target system, such as hardware and software information
To automate the deployment of software to a target system
To configure network settings on a target system
Which of the following Ansible modules can be used to create a directory on target nodes?
template
package
file
directory
lineinfile
Which command will you use to run an Ansible playbook called apache.yaml?
ansible apache.yaml
ansible -p apache.yaml
ansible-playbook apache.yaml
ansible --playbook apache.yaml
Which flag would you use with ansible-playbook cli to initialize variables for the playbook you are about to run?
-e
--extra-vars
-v
--vars
--args
Which of the following statements are true about Ansible inventory file?
A file that contains the list of target hosts
Located at "/etc/ansible/hosts" by default
A file that contains the module definitions
We can use multiple inventory files by using -i flag
We can use multiple inventory files by using -h flag
