{"id":6866,"date":"2019-10-07T08:02:40","date_gmt":"2019-10-07T08:02:40","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=6866"},"modified":"2021-11-16T07:13:30","modified_gmt":"2021-11-16T07:13:30","slug":"ansible-interview-questions-and-answer-part-2","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/ansible-interview-questions-and-answer-part-2\/","title":{"rendered":"Ansible Interview Questions and Answer &#8211; Part 2"},"content":{"rendered":"\n<ol class=\"wp-block-list\"><li>What is the purpose and location of  ansible.cfg file.<\/li><li>Name any two settings from anible.cfg file.<\/li><li>Please write below a sample inventory file with host, group &amp; group of groups syntax in it.<\/li><li>What is the diffrence between group_vars &amp; host_vars directory?<\/li><li>What are adhocs commands used for &amp; write below syntax of a ad hocs command?<\/li><li>Write below ad hoc command to gather fact varibales on all the hosts from the inventory file?<\/li><li>What format does ansible ad hoc command returns the output?<\/li><li>Name three types of modules in ansible?<\/li><li>Name any 10 modules in ansible that you have used.<\/li><li>How to list all the ansible core modules from command line.<\/li><li>How to display all the options\/attributes for apt module from command line.<\/li><li>How can you check mandatory option for any module from command line?<\/li><li>What is setup module used for?<\/li><li>Write down sample global play declaration<\/li><li>Write down any two tasks from playbook with its proper format and names.<\/li><li>Whats is the diffrence between sudo and become module and its purpose.<\/li><li>Write down playbook syntax of starting ntp service on webserver and dbservers host group at once.<\/li><li>How to take user input from a playbook?<\/li><li>What is debug module used for in playbooks?<\/li><li>How to store output of any task into a varible from playbook?<\/li><\/ol>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_15026\"><iframe loading=\"lazy\"  id=\"_ytid_60694\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_15026\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>What is the purpose and location of ansible.cfg file. Name any two settings from anible.cfg file. Please write below a sample inventory file with host, group &amp; group of groups&#8230; <\/p>\n","protected":false},"author":1,"featured_media":8349,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5038],"tags":[],"class_list":["post-6866","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=6866"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6866\/revisions"}],"predecessor-version":[{"id":25407,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6866\/revisions\/25407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/8349"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=6866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=6866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=6866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}