热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Ansible 面试题与答案

相关差异对比

Ansible vs TerraformAnsible vs Puppet

问题 11. What is the purpose of the 'become' keyword in Ansible?

The 'become' keyword is used to execute tasks with escalated privileges, usually by using 'sudo' or 'su'. It is equivalent to 'sudo' in Unix-like systems.

Example:

become: yes

这有帮助吗? 添加评论 查看评论
 

问题 12. Explain Ansible facts.

Ansible facts are pieces of system information collected during playbook execution. They provide details about the target system, such as hardware, network, and OS.

这有帮助吗? 添加评论 查看评论
 

问题 13. How can you execute only a specific task from an Ansible playbook?

You can use the '--tags' option followed by the task tag when running the 'ansible-playbook' command to execute specific tasks.

Example:

ansible-playbook site.yml --tags deploy

这有帮助吗? 添加评论 查看评论
 

问题 14. What is the purpose of the 'notify' keyword in Ansible?

The 'notify' keyword is used to trigger handlers. It specifies a task or a list of tasks to be executed if the associated task results in a change.

Example:

notify: restart apache

这有帮助吗? 添加评论 查看评论
 

问题 15. How can you check the syntax of an Ansible playbook without executing it?

You can use the 'ansible-playbook' command with the '--syntax-check' option to validate the syntax of a playbook without running it.

Example:

ansible-playbook site.yml --syntax-check

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。