{"id":12585,"date":"2023-06-05T21:12:57","date_gmt":"2023-06-06T04:12:57","guid":{"rendered":"https:\/\/www.apolonio.com\/blog\/?p=12585"},"modified":"2023-06-05T21:12:57","modified_gmt":"2023-06-06T04:12:57","slug":"first-day-ansible-class","status":"publish","type":"post","link":"https:\/\/www.apolonio.com\/blog\/?p=12585","title":{"rendered":"First Day Ansible Class"},"content":{"rendered":"\n<p>Wasn&#8217;t able to get much steps in today, but I got it done.  I was in class most of the day learning ansible.<\/p>\n\n\n\n<p>So for future reference here is how I install it on to Rocky Linux 9.  Note that you will need a Red Hat account, although it is free.<\/p>\n\n\n\n<p>First build you Rocky 9 machine and make sure to modify \/etc\/subuid and \/etc\/subgid and add the follow (where ansibleuser is the account you will use)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ansibleuser:100000:65536<\/code><\/pre>\n\n\n\n<p>Then<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y install ansible-core<br>sudo dnf -y install python3-pip<br>pip install --user ansible-navigator<br>podman login registry.redhat.io<br>podman pull registry.redhat.io\/ansible-automation-platform-22\/ee-supported-rhel8<\/code><\/pre>\n\n\n\n<p>In the user&#8217;s home folder create an ansible folder<\/p>\n\n\n\n<p>In that folder create a file named inventory with the list of machines you want to manage<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi inventory<br>a-server1<br>a-server2<br>a-server3<br>a-server4<\/code><\/pre>\n\n\n\n<p>Also create an ansible config file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi ansible.cfg\n&#91;defaults]\ninventory = .\/ansible\nremote_user = ansibleuser\nask_pass = false\n&#91;privilege_escalation]\nbecome = true\nbecome_method = sudo\nbecome_user = root\nbecome_ask_pass = false<\/code><\/pre>\n\n\n\n<p>On each of the hosts make sure the ansible use can sudo<\/p>\n\n\n\n<p>You should be able to test, here are some sample commands<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ansible-navigator images<br>ansible-navigator run -m stdout ping-web.yml<br>ansible-navigator inventory -m stdout --list<br>ansible-navigator inventory -m stdout --graph<br>ansible -m ping all<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ansible -m shell -a 'hostname' all<br>ansible -m shell -a 'id' all<br>ansible -m shell -a 'echo \"hello\" > \/tmp\/hello.txt' all<\/code><\/pre>\n\n\n\n<p>Got a new filament holder for my 3D printer, one that has bearings and actually spins to reduce friction when feeding the printer.  It also extends the spool a few inches outwards so it feeds in a more straight path.<\/p>\n\n\n\n<p>Going to test  a few runs, see if it improves things, could be the filament, and it is wet.<\/p>\n\n\n\n<p>Still chugging along<\/p>\n\n\n\n<p>Weight: 337.0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wasn&#8217;t able to get much steps in today, but I got it done. I was in class most of the day learning ansible. So for future reference here is how I install it on to Rocky Linux 9. Note that &hellip; <a href=\"https:\/\/www.apolonio.com\/blog\/?p=12585\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,14,11,3,9],"tags":[],"class_list":["post-12585","post","type-post","status-publish","format-standard","hentry","category-fitbit","category-new-toys","category-technical","category-training","category-weighin"],"_links":{"self":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12585"}],"version-history":[{"count":1,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12585\/revisions"}],"predecessor-version":[{"id":12586,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12585\/revisions\/12586"}],"wp:attachment":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}