{"id":9569,"date":"2026-08-13T17:04:01","date_gmt":"2026-08-13T17:04:01","guid":{"rendered":"http:\/\/blog.dankohn.info\/?p=9569"},"modified":"2026-08-13T18:09:09","modified_gmt":"2026-08-13T18:09:09","slug":"my-ansible-install-on-a-pi","status":"publish","type":"post","link":"https:\/\/blog.dankohn.info\/index.php\/2026\/08\/13\/my-ansible-install-on-a-pi\/","title":{"rendered":"My Ansible Install on a PI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Useful Links:<br><a href=\"https:\/\/geektechstuff.com\/2019\/06\/25\/installing-ansible-raspberry-pi\/\">https:\/\/geektechstuff.com\/2019\/06\/25\/installing-ansible-raspberry-pi\/<\/a><br><a href=\"https:\/\/docs.ansible.com\/projects\/ansible\/latest\/reference_appendices\/config.html#ansible-configuration-settings-locations\">https:\/\/docs.ansible.com\/projects\/ansible\/latest\/reference_appendices\/config.html#ansible-configuration-settings-locations<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Did the install commands:<br><em>sudo apt-get update<\/em><br><em>sudo apt-get upgrade<\/em><br><em>sudo apt install ansible<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">this did not create the default directory \/etc\/ansible or the default config files so had to do the following:<br><em>sudo mkdir -p \/etc\/ansible<br>sudo touch \/etc\/ansible\/ansible.cfg \/etc\/ansible\/hosts<\/em><br><em>ansible-config init &#8211;disabled > ansible.cfg<br>sudo mv ansible.cfg \/etc\/ansible\/ansible.cfg<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now check the config:<br><em>ansible \u2013version<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now edited the hosts file for ansible<br><em>sudo pico -w \/etc\/ansible\/hosts<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and put in a test group:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>[test]<br>192.168.0.1<br>192.168.0.2<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">errored as predicted in <a href=\"https:\/\/geektechstuff.com\/2019\/06\/25\/installing-ansible-raspberry-pi\/\">https:\/\/geektechstuff.com\/2019\/06\/25\/installing-ansible-raspberry-pi\/<\/a> but I did not like the solution of ssh keys, so I found how to add name and password to host file:<br><em>[test]<br>192.168.0.212<br><br>[test:vars]<br>ansible_user=user<br>ansible_password=*******<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and that worked for what I want (to be able to log into switches and routers to run commands<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Useful Links:https:\/\/geektechstuff.com\/2019\/06\/25\/installing-ansible-raspberry-pi\/https:\/\/docs.ansible.com\/projects\/ansible\/latest\/reference_appendices\/config.html#ansible-configuration-settings-locations Did the install commands:sudo apt-get updatesudo apt-get upgradesudo apt install ansible this did not create the default directory \/etc\/ansible or the default config files so had to do the following:sudo mkdir -p \/etc\/ansiblesudo touch \/etc\/ansible\/ansible.cfg \/etc\/ansible\/hostsansible-config init &#8211;disabled &hellip; <a href=\"https:\/\/blog.dankohn.info\/index.php\/2026\/08\/13\/my-ansible-install-on-a-pi\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-9569","post","type-post","status-publish","format-standard","hentry","category-networking"],"_links":{"self":[{"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/posts\/9569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/comments?post=9569"}],"version-history":[{"count":3,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/posts\/9569\/revisions"}],"predecessor-version":[{"id":9572,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/posts\/9569\/revisions\/9572"}],"wp:attachment":[{"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/media?parent=9569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/categories?post=9569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dankohn.info\/index.php\/wp-json\/wp\/v2\/tags?post=9569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}