<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Keith Maxwell</title>
    <description>The latest articles on DEV Community by Keith Maxwell (@maxwellk).</description>
    <link>https://dev.to/maxwellk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F345691%2Faa4bcad2-b4c7-43a3-af94-7984ecdc220c.jpeg</url>
      <title>DEV Community: Keith Maxwell</title>
      <link>https://dev.to/maxwellk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxwellk"/>
    <language>en</language>
    <item>
      <title>Using GoLand on Fedora Silverblue</title>
      <dc:creator>Keith Maxwell</dc:creator>
      <pubDate>Fri, 10 Apr 2020 20:01:21 +0000</pubDate>
      <link>https://dev.to/maxwellk/using-goland-on-fedora-silverblue-2agh</link>
      <guid>https://dev.to/maxwellk/using-goland-on-fedora-silverblue-2agh</guid>
      <description>&lt;p&gt;I could find very little information online about running &lt;a href="https://www.jetbrains.com/go/"&gt;JetBrains GoLand&lt;/a&gt; on Fedora Silverblue. I hope this post will change that. I have tested the instructions below with the latest version, &lt;code&gt;2020.1&lt;/code&gt; — &lt;a href="https://www.jetbrains.com/go/download/other.html"&gt;released yesterday&lt;/a&gt; — and the previous version &lt;code&gt;2019.3.4&lt;/code&gt; both on &lt;a href="https://docs.fedoraproject.org/en-US/fedora-silverblue/"&gt;Fedora Silverblue&lt;/a&gt; 30.&lt;/p&gt;

&lt;p&gt;Using Fedora Silverblue as a desktop operating system means that “every installation is identical to every other installation of the same version”. I am a very happy Fedora Silverblue user; last year I gave &lt;a href="https://github.com/maxwell-k/20191023-Belfast-Linux-User-Group-Silverblue-talk"&gt;a talk&lt;/a&gt; explaining why.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why GoLand?
&lt;/h1&gt;

&lt;p&gt;I normally try to use open source rather than proprietary software wherever possible. I am a long term &lt;a href="https://www.vim.org"&gt;vim&lt;/a&gt; user. Saying that, I also actively try to stay open minded about technology. In the end, I decided to try out GoLand because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it was widely endorsed at &lt;a href="https://www.meetup.com/Belfast-Gophers/"&gt;Belfast Gophers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;a lot of people I respect from &lt;a href="https://socratesuk.org"&gt;SoCraTes UK&lt;/a&gt; are JetBrains fans&lt;/li&gt;
&lt;li&gt;a recent coding test / interview involved pairing with a developer using another JetBrains product; a bit of exposure to JetBrains can only help in that sort of situation&lt;/li&gt;
&lt;li&gt;I've already got a licence, from a Legacy Code Retreat event in 2019; the first year of a GoLand licence &lt;a href="https://www.jetbrains.com/store/?fromNavMenu#commercial?billing=yearly"&gt;normally costs&lt;/a&gt; £149.00.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Installation process
&lt;/h1&gt;

&lt;p&gt;On Fedora Silverblue the &lt;a href="https://docs.fedoraproject.org/en-US/fedora-silverblue/technical-information/#filesystem-layout"&gt;root filesystem&lt;/a&gt; is immutable although certain mutable directories are made available from &lt;code&gt;/var&lt;/code&gt;. On another system I would install into &lt;code&gt;/opt&lt;/code&gt;, to follow the &lt;a href="https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard"&gt;Filesystem Hierarchy Standard&lt;/a&gt;. On Fedora Silverblue &lt;code&gt;/opt&lt;/code&gt; is a symbolic link to &lt;code&gt;/var/opt&lt;/code&gt; so I'll install there. I also add a link to the &lt;code&gt;PATH&lt;/code&gt;; &lt;code&gt;/usr/local/bin&lt;/code&gt; is writable via &lt;code&gt;/var/usrlocal&lt;/code&gt; which is mounted at &lt;code&gt;/usr/local&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2020.1
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /var/opt/goland
&lt;span class="nb"&gt;cd&lt;/span&gt; /var/opt/goland
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOGNAME&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$LOGNAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
curl &lt;span class="nt"&gt;-OL&lt;/span&gt; https://download.jetbrains.com/go/goland-&lt;span class="nv"&gt;$version&lt;/span&gt;.tar.gz
curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://download.jetbrains.com/go/goland-&lt;span class="nv"&gt;$version&lt;/span&gt;.tar.gz.sha256
&lt;span class="nb"&gt;sha256sum&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; goland-&lt;span class="nv"&gt;$version&lt;/span&gt;.tar.gz.sha256
&lt;span class="nb"&gt;tar &lt;/span&gt;xf goland-&lt;span class="nv"&gt;$version&lt;/span&gt;.tar.gz
&lt;span class="nb"&gt;cd &lt;/span&gt;GoLand-&lt;span class="nv"&gt;$version&lt;/span&gt;/bin
&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/goland.sh"&lt;/span&gt; /var/usrlocal/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Alt-F2&lt;/code&gt; then &lt;code&gt;goland.sh⏎&lt;/code&gt; should start GoLand!&lt;/p&gt;

&lt;p&gt;Next up activate your licence. Then use the UI to download an SDK ( File → Settings → GOROOT ); this happens in the background. I chose 1.13.8 to match the &lt;a href="https://pkgs.alpinelinux.org/package/edge/community/x86_64/go"&gt;current version in Alpine Linux edge&lt;/a&gt;. After that I was all set; I started working through “The Hitchhiker's Guide to GoLand”.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debugging
&lt;/h2&gt;

&lt;p&gt;If you have an issue it might help to see messages printed to a terminal; instead at the same terminal as above try: &lt;code&gt;./goland.sh⏎&lt;/code&gt;. At first I was connected via SSH without &lt;code&gt;$DISPLAY&lt;/code&gt; set properly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why did this need a blog post?
&lt;/h1&gt;

&lt;p&gt;Fedora Silverblue is an immutable desktop operating system. The recommended methods for running GUI software include Flatpaks and or other containers using &lt;a href="https://github.com/containers/toolbox"&gt;toolbox&lt;/a&gt; or even &lt;a href="https://github.com/containers/libpod"&gt;Podman&lt;/a&gt; directly. It is also possible to layer or install traditionally packaged applications with &lt;code&gt;rpm-ostree&lt;/code&gt; but that introduces differences between one system and the next.&lt;/p&gt;

&lt;p&gt;My early research didn't show a straight forward answer. The possibilities I came across included: an &lt;a href="https://hub.docker.com/r/rycus86/goland/"&gt;unofficial container&lt;/a&gt;, the official &lt;a href="https://snapcraft.io/goland"&gt;snap that JetBrains publish&lt;/a&gt; or even using &lt;a href="https://github.com/AppImage/pkg2appimage/blob/master/recipes/GoLand"&gt;an AppImage&lt;/a&gt;. &lt;a href="https://youtrack.jetbrains.com/issue/GO-7441"&gt;No Flatpak is available&lt;/a&gt;. Snaps are more common on Ubuntu, on Fedora Silverblue the background service would have to be installed first: either inside a container or as a layer with &lt;code&gt;rpm-ostree&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I should probably have jumped into trying this out practically more quickly. The JetBrains &lt;a href="https://www.jetbrains.com/help/go/installation-guide.html"&gt;installation guide&lt;/a&gt; doesn't give much detail about this approach, but the files are clearly linked from the JetBrains &lt;a href="https://www.jetbrains.com/go/download/#section=linux"&gt;Linux download page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This isn't the perfect installation method but a set of compromises; one disadvantage is that it doesn't provide a launcher. While I knew there would be compromises, I wanted to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Avoid changing the base Fedora Silverblue system with &lt;code&gt;rpm-ostree&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Avoid a complicated setup that includes manually installed dependencies&lt;/li&gt;
&lt;li&gt;Use a supported, official method&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the end I didn't have to compromise on these three points. The process of writing out and ordering the potential compromises for someone else to follow helped me to prioritise the order in which I investigated options.&lt;/p&gt;




&lt;p&gt;Installing GoLand under Fedora Silverblue was easier than I expected. I wonder what other surprises I will find now I have GoLand up and running.&lt;/p&gt;

</description>
      <category>go</category>
      <category>tooling</category>
      <category>jetbrains</category>
      <category>fedora</category>
    </item>
    <item>
      <title>Actionable output from Ansible 2.11</title>
      <dc:creator>Keith Maxwell</dc:creator>
      <pubDate>Fri, 03 Apr 2020 12:42:30 +0000</pubDate>
      <link>https://dev.to/maxwellk/actionable-output-from-ansible-2-11-2mo3</link>
      <guid>https://dev.to/maxwellk/actionable-output-from-ansible-2-11-2mo3</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ANSIBLE_DISPLAY_SKIPPED_HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;no &lt;span class="nv"&gt;ANSIBLE_DISPLAY_OK_HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;no &lt;span class="se"&gt;\&lt;/span&gt;
    ansible-playbook &lt;span class="nt"&gt;-i&lt;/span&gt;, site.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;p&gt;Though there is more to say than that. This is my first blog on &lt;a href="https://dev.to"&gt;https://dev.to&lt;/a&gt; and I've ideas and drafts for many more. I was really encouraged by &lt;a href="https://blog.miguelgrinberg.com"&gt;Miguel Grinberg&lt;/a&gt;'s &lt;a href="https://github.com/PyConLimerick/Limerick2020/blob/master/Abstracts/09_Grinsberg_Miguel_Python_Community_Engagement.md"&gt;talk&lt;/a&gt; at &lt;a href="https://python.ie/pycon-limerick-2020/"&gt;PyCon Limerick&lt;/a&gt;. I am pleased to have put a post out into the world.&lt;/p&gt;

&lt;p&gt;I am a big fan of Ansible and have found the community, especially the documentation team, very welcoming. I've been using Ansible since around version 2.4 which was &lt;a href="https://pypi.org/project/ansible/#history"&gt;released in 2017&lt;/a&gt;. The current version is 2.9.&lt;/p&gt;

&lt;p&gt;Ansible 2.7 deprecated a feature for limiting the output of the &lt;code&gt;ansible-playbook&lt;/code&gt; command line interface (CLI). It is scheduled to be removed in 2.11. This post explains a little context and how to switch over to the new approach.&lt;/p&gt;

&lt;p&gt;As you may know, deprecation is a process for removing features from software; in Ansible deprecation follows &lt;a href="https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#deprecation-cycle"&gt;a policy&lt;/a&gt;. This process gives users warnings and an opportunity to move away from the deprecated feature before anything relying on it breaks.&lt;/p&gt;




&lt;p&gt;Simplifying a little, an Ansible playbook runs a series of tasks against a host. By default the &lt;code&gt;ansible-playbook&lt;/code&gt; CLI reports back the status from each task. This can be reported as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;OK: completed successfully and nothing was changed&lt;/li&gt;
&lt;li&gt;Changed: completed successfully with changes&lt;/li&gt;
&lt;li&gt;Failed: the task did not complete . Skipped: the task was not run, likely because of a &lt;code&gt;when:&lt;/code&gt; clause&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ansible will report a task as unreachable if it cannot contact the host. Further &lt;a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#ignoring-failed-commands"&gt;ignored&lt;/a&gt; and &lt;a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html#block-error-handling"&gt;rescued&lt;/a&gt; relate to bespoke error handling.&lt;/p&gt;

&lt;p&gt;Quickly identifying tasks with a changed status is a helpful filter. It is particularly effective if you write &lt;a href="https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-idempotency"&gt;idempotent&lt;/a&gt; playbooks. Failed tasks are also of interest.&lt;/p&gt;

&lt;p&gt;If you are tracking configuration as code, for example as Ansible playbooks in a git repository, this filtering makes it easier to marry the system changes reported by Ansible and the configuration changes in git.&lt;/p&gt;

&lt;p&gt;Before Ansible 2.7 the recommended way to filter output to only show tasks with a changed or failed status was the &lt;a href="https://docs.ansible.com/ansible/latest/plugins/callback/actionable.html"&gt;actionable&lt;/a&gt; plugin. In Ansible 2.11 that plugin will be removed.&lt;/p&gt;

&lt;p&gt;The current approach is to set two options and use the &lt;a href="https://docs.ansible.com/ansible/latest/plugins/callback/default.html"&gt;default output plugin&lt;/a&gt;. The two commands below show the old and new approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ANSIBLE_STDOUT_CALLBACK&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;actionable ansible-playbook &lt;span class="nt"&gt;-i&lt;/span&gt;, site.yaml
&lt;span class="nv"&gt;ANSIBLE_DISPLAY_SKIPPED_HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;no &lt;span class="nv"&gt;ANSIBLE_DISPLAY_OK_HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;no &lt;span class="se"&gt;\&lt;/span&gt;
    ansible-playbook &lt;span class="nt"&gt;-i&lt;/span&gt;, site.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There are many different ways to set these options; either &lt;a href="https://docs.ansible.com/ansible/latest/plugins/callback.html"&gt;in configuration files&lt;/a&gt; or environment variables. The change is the same regardless: instead of overriding the &lt;a href="https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-stdout-callback"&gt;default callback plugin for standard out&lt;/a&gt;, &lt;code&gt;stdout_callback=actionable&lt;/code&gt;, instead set two options on the default callback: &lt;code&gt;display_skipped_hosts=no&lt;/code&gt; and &lt;code&gt;display_ok_hosts=no&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For more detail about the background to this change, take a look at the GitHub &lt;a href="https://github.com/ansible/ansible/pull/41058"&gt;pull request&lt;/a&gt; and &lt;a href="https://github.com/ansible/ansible/commit/9c5d40ff152a8a94dc226735ce43593ebbb10104"&gt;commit&lt;/a&gt; implementing the deprecation.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>devops</category>
      <category>git</category>
      <category>intro</category>
    </item>
  </channel>
</rss>
