{"id":1604,"date":"2016-12-07T12:44:39","date_gmt":"2016-12-07T12:44:39","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=1604"},"modified":"2023-02-10T14:07:23","modified_gmt":"2023-02-10T14:07:23","slug":"apache-installation-using-ansible-playbook","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/","title":{"rendered":"How to install Apache using Ansible Playbook"},"content":{"rendered":"<p align=\"left\"><span style=\"color: #404040\"><span style=\"font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif\"><span style=\"font-size: medium\">Here we are introducing a playbook and how it works with Ansible in Linux servers.<\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #404040\"><span style=\"font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif\"><span style=\"font-size: medium\">Playbooks can run multiple tasks and jobs and provide some more advanced functionality, it&#8217;s used to define deployment and configurations in a single file, using\u00a0the playbook we can manage our configurations and deployments on remote machines.\u00a0 Ansible playbook config files\u00a0are written in the simple YAML, the playbooks are designed to be human-readable and developed in a basic text language. As the playbooks expressed in YAML format and have a minimum of syntax, which intentionally tries to not be a programming language or script, but rather a model of a configuration or a process. <\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #404040\"><span style=\"font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif\"><span style=\"font-size: medium\">A YAML script always starts with \u201c&#8212;\u201d and ends with \u201c&#8230;\u201d <\/span><\/span><\/span><\/p>\n<p align=\"justify\"><span style=\"color: #404040\"><span style=\"font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif\"><span style=\"font-size: medium\">Apache installation using Ansible playbook : <\/span><\/span><\/span><\/p>\n<pre class=\"lang:default decode:true\">---\n\n- hosts: webkul # hosts to be configured\n\nsudo: yes # sudo permissions\n\ntasks:\n\n- name: update\n\napt: update_cache=yes\n\n- name: install apache2\n\napt: name=apache2 state=present\n\n- name: restart apache2\n\nservice: name=apache2 state=restarted\n\n- debug: msg=\"apache has been installed\"\n\n...\n\n<\/pre>\n<blockquote>\n<h3><strong>How above codes is working ?<\/strong><\/h3>\n<p>&#8211; name: use comand to run \u201capt-get update\u201d<\/p>\n<p>apt: update_cache=yes : used to update the cache<\/p>\n<p>&#8211; name : use to run command \u201capt-get install apache2\u201d<\/p>\n<p>apt: name=apache2 state=present<\/p>\n<p>&#8211; name: to restart apache service<\/p>\n<p>service: name=apache2 state= restart<\/p>\n<p>-debug: msg : used to display installation message.<\/p><\/blockquote>\n<p style=\"text-align: center\">\u00a0\u00a0<a href=\"http:\/\/cloudkul.com\/contact\/\">CONTACT US IN CASE OF ANY QUERY<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here we are introducing a playbook and how it works with Ansible in Linux servers. <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":10,"featured_media":1610,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[86],"tags":[92,204,95],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install Apache using Ansible Playbook - Cloudkul<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install Apache using Ansible Playbook - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Here we are introducing a playbook and how it works with Ansible in Linux servers. [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-07T12:44:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-10T14:07:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/download-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"gajendra nath\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\",\"name\":\"How to install Apache using Ansible Playbook - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2016-12-07T12:44:39+00:00\",\"dateModified\":\"2023-02-10T14:07:23+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/3232dccbd607c3019393e41541357404\"},\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Apache using Ansible Playbook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/3232dccbd607c3019393e41541357404\",\"name\":\"gajendra nath\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a5ebac9203a3f62a79f03c685839cbf?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a5ebac9203a3f62a79f03c685839cbf?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"gajendra nath\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/gajendra-nath921\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Apache using Ansible Playbook - Cloudkul","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/","og_locale":"en_US","og_type":"article","og_title":"How to install Apache using Ansible Playbook - Cloudkul","og_description":"Here we are introducing a playbook and how it works with Ansible in Linux servers. [...]","og_url":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/","og_site_name":"Cloudkul","article_published_time":"2016-12-07T12:44:39+00:00","article_modified_time":"2023-02-10T14:07:23+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/download-4.png","type":"image\/png"}],"author":"gajendra nath","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/","url":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/","name":"How to install Apache using Ansible Playbook - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2016-12-07T12:44:39+00:00","dateModified":"2023-02-10T14:07:23+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/3232dccbd607c3019393e41541357404"},"breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/apache-installation-using-ansible-playbook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install Apache using Ansible Playbook"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/3232dccbd607c3019393e41541357404","name":"gajendra nath","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a5ebac9203a3f62a79f03c685839cbf?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a5ebac9203a3f62a79f03c685839cbf?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"gajendra nath"},"url":"https:\/\/cloudkul.com\/blog\/author\/gajendra-nath921\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1604"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=1604"}],"version-history":[{"count":17,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions"}],"predecessor-version":[{"id":14856,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions\/14856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/1610"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=1604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=1604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=1604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}