{"id":8588,"date":"2016-07-20T11:38:10","date_gmt":"2016-07-20T09:38:10","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/"},"modified":"2016-07-20T11:38:10","modified_gmt":"2016-07-20T09:38:10","slug":"gettin-ansible-up-and-running-on-a-sles-12-sp1-host","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/","title":{"rendered":"Getting Ansible up and running on a SLES 12 SP1 host"},"content":{"rendered":"<p>Recently at a customer we had to setup <a href=\"https:\/\/www.ansible.com\/\" target=\"_blank\" rel=\"noopener\">Ansible<\/a> on a <a href=\"https:\/\/www.suse.com\/products\/server\" target=\"_blank\" rel=\"noopener\">SLES 12 SP1<\/a> host. In comparison to RedHat or Ubuntu based distributions there are some more steps to do as Ansible is not included in the standard SLES repositories. Here we go &#8230;<\/p>\n<p><!--more--><\/p>\n<p>Start with the user, group, directories and permissions:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nhost:~ # groupadd ansible\nhost:~ # useradd -g ansible -m ansible\nhost:~ # passwd ansible\nhost:~ # mkdir \/opt\/ansible\nhost:~ # chown ansible:ansible \/opt\/ansible\nhost:~ # mkdir \/etc\/ansible\nhost:~ # chown ansible:ansible \/etc\/ansible\nhost:~ # touch \/etc\/ansible\/hosts\nhost:~ # chown ansible:ansible \/etc\/ansible\/hosts\nhost:~ # chmod 600 \/etc\/ansible\/hosts\n<\/pre>\n<p>In our case we wanted to install Ansible directly from the git repository on github so we needed to install git:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nhost:~ # zypper install git\n<\/pre>\n<p>As <a href=\"https:\/\/pypi.python.org\/pypi\/pip\" target=\"_blank\" rel=\"noopener\">pip<\/a> was not available in the os repositories we had to install manually:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nhost:~ # cd \/var\/tmp\nhost:~ # export http_proxy=proxy:port    # if a proxy is used\nhost:~ # export https_proxy=proxy:port   # if a proxy is used\nhost:~ # wget https:\/\/bootstrap.pypa.io\/get-pip.py\nhost:~ # python get-pip.py\nhost:~ # pip install paramiko PyYAML Jinja2 httplib2 six\n<\/pre>\n<p>Installing Ansible from here on is straight forward:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nhost:\/var\/tmp # su - ansible\nansible@host:~&gt; cd \/opt\/ansible\/\nansible@host:\/opt\/ansible&gt; export http_proxy=webproxy.amag.car.web:8080\nansible@host:\/opt\/ansible&gt; export https_proxy=webproxy.amag.car.web:8080\nansible@host:\/opt\/ansible&gt; git config --global http.proxy $http_proxy\nansible@host:\/opt\/ansible&gt; git config --global https.proxy $http_proxy\nansible@host:\/opt\/ansible&gt;git clone https:\/\/github.com\/ansible\/ansible.git --recursive\nansible@host:\/opt\/ansible&gt;cd ansible\nansible@host:\/opt\/ansible\/ansible&gt; git pull --rebase\nCurrent branch devel is up to date.\nansible@host:\/opt\/ansible\/ansible&gt; ansible@s1100tap460:\/opt\/ansible\/ansible&gt; git submodule update --init --recursive\n<\/pre>\n<p>Ansible provides a script which makes it easy to setup the environment:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@host:\/opt\/ansible\/ansible&gt;cd ansible\nansible@host:\/opt\/ansible\/ansible&gt;. hacking\/env-setup\n<\/pre>\n<p>This does the initial stuff required for running Ansible out of a git repository and does set all the environment variables. It is  good idea to do this automatically once you login as ansible user:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@host:\/opt\/ansible\/ansible&gt; echo \". \/opt\/ansible\/ansible\/hacking\/env-setup -q\" &gt;&gt; ~\/.bash_profile\n<\/pre>\n<p>Now you can execute ansible without adjusting your environment or switching to the installation directory:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@host:\/opt\/ansible\/ansible&gt; which ansible\n\/opt\/ansible\/ansible\/bin\/ansible\nansible@host:\/opt\/ansible\/ansible&gt; ansible --version\nansible 2.2.0 (devel 4cc4dc6793) last updated 2016\/07\/19 13:51:23 (GMT +200)\n  lib\/ansible\/modules\/core: (detached HEAD 7de287237f) last updated 2016\/07\/19 13:51:40 (GMT +200)\n  lib\/ansible\/modules\/extras: (detached HEAD 68ca157f3b) last updated 2016\/07\/19 13:51:53 (GMT +200)\n  config file =\n<\/pre>\n<p>To test we can add the localhost to the Ansible inventory:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@host:\/opt\/ansible\/ansible&gt; echo \"127.0.0.1\" &gt;&gt; \/etc\/ansible\/hosts\n<\/pre>\n<p>&#8230; and then exchange the public ssh key of the ansible user:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@host:~&gt; ssh-keygen -t dsa\nansible@host:~&gt; ssh-copy-id -i ~\/.ssh\/id_dsa.pub ansible@127.0.0.1\n<\/pre>\n<p>Do a functional test:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\nansible@s1100tap460:~&gt;  ansible all -m ping\n127.0.0.1 | SUCCESS =&gt; {\n    \"changed\": false,\n    \"ping\": \"pong\"\n}\n<\/pre>\n<p>&#8230; and your done. Happy deploying &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently at a customer we had to setup Ansible on a SLES 12 SP1 host. In comparison to RedHat or Ubuntu based distributions there are some more steps to do as Ansible is not included in the standard SLES repositories. Here we go &#8230;<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[150],"type_dbi":[],"class_list":["post-8588","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-ansible"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Getting Ansible up and running on a SLES 12 SP1 host - dbi Blog<\/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:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Ansible up and running on a SLES 12 SP1 host\" \/>\n<meta property=\"og:description\" content=\"Recently at a customer we had to setup Ansible on a SLES 12 SP1 host. In comparison to RedHat or Ubuntu based distributions there are some more steps to do as Ansible is not included in the standard SLES repositories. Here we go &#8230;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-20T09:38:10+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"Getting Ansible up and running on a SLES 12 SP1 host\",\"datePublished\":\"2016-07-20T09:38:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\"},\"wordCount\":196,\"commentCount\":0,\"keywords\":[\"Ansible\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\",\"name\":\"Getting Ansible up and running on a SLES 12 SP1 host - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2016-07-20T09:38:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Ansible up and running on a SLES 12 SP1 host\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Getting Ansible up and running on a SLES 12 SP1 host - dbi Blog","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:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/","og_locale":"en_US","og_type":"article","og_title":"Getting Ansible up and running on a SLES 12 SP1 host","og_description":"Recently at a customer we had to setup Ansible on a SLES 12 SP1 host. In comparison to RedHat or Ubuntu based distributions there are some more steps to do as Ansible is not included in the standard SLES repositories. Here we go &#8230;","og_url":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/","og_site_name":"dbi Blog","article_published_time":"2016-07-20T09:38:10+00:00","author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"Getting Ansible up and running on a SLES 12 SP1 host","datePublished":"2016-07-20T09:38:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/"},"wordCount":196,"commentCount":0,"keywords":["Ansible"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/","url":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/","name":"Getting Ansible up and running on a SLES 12 SP1 host - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-07-20T09:38:10+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/gettin-ansible-up-and-running-on-a-sles-12-sp1-host\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting Ansible up and running on a SLES 12 SP1 host"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=8588"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8588\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=8588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=8588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=8588"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=8588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}