<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Devops</title><link>https://jwheel.org/tags/devops/</link><description>Homepage of Justin Wheeler, an Open Source contributor and Free Software advocate from Georgia, USA.</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>Justin Wheeler</managingEditor><lastBuildDate>Sun, 21 Aug 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://jwheel.org/rss/tags/devops/index.xml" rel="self" type="application/rss+xml"/><item><title>GSoC 2016: That's a wrap!</title><link>https://jwheel.org/blog/2016/08/gsoc-2016-thats-wrap/</link><pubDate>Sun, 21 Aug 2016 00:00:00 +0000</pubDate><guid>https://jwheel.org/blog/2016/08/gsoc-2016-thats-wrap/</guid><description><![CDATA[<p>Tomorrow, August 22, 2016, marks the end of the <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> 2016 program. This year, I participated as a student for the Fedora Project working on my proposal, &ldquo;<a href="https://summerofcode.withgoogle.com/archive/2016/projects/4844704050970624/"><em>Ansible and the Community (or automation improving innovation)</em></a>&rdquo;. You can read my <a href="https://fedoraproject.org/wiki/GSOC_2016/Student_Application_jflory7">original project proposal</a> on the Fedora wiki. Over the summer, I spent time learning more about <a href="https://www.ansible.com/">Ansible</a>, applying the knowledge to real-world applications, and then taking that experience and writing my final deliverable. The last deliverable items, closing plans, and thoughts on the journey are detailed as follows.</p>

<h2 id="deliverable-items">Deliverable items&nbsp;<a class="hanchor" href="#deliverable-items" aria-label="Anchor link for: Deliverable items">🔗</a></h2>
<p>The last deliverable items from my project are two (2) git patches, one (1) git repository, and seven (7) blog posts (including this one).</p>
<ul>
<li>Git patches (<a href="https://jflory7.fedorapeople.org/pub/gsoc/2016/patches/0001-Add-role-and-playbooks-for-installing-and-upgrading-.patch">ansible.git</a> and <a href="https://jflory7.fedorapeople.org/pub/gsoc/2016/patches/0001-Add-WordPress-SOP-based-on-corresponding-additions-t.patch">infra-docs.git</a>)</li>
<li><a href="https://pagure.io/jflory7-ansible">Git repository</a></li>
<li><a href="https://jwfblog.wpenginepowered.com/tag/gsoc/feed/">Blog posts</a></li>
</ul>

<h2 id="closing-plans">Closing plans&nbsp;<a class="hanchor" href="#closing-plans" aria-label="Anchor link for: Closing plans">🔗</a></h2>
<p>At the end of the summer, I was using a private cloud instance in Fedora&rsquo;s infrastructure for testing my playbooks and other resources. One of the challenges towards the end of my project was moving my changes from my local development instance into a more permanent part of Fedora&rsquo;s infrastructure. For these reasons, I had some issues with running them in a context and workflow specific to Fedora&rsquo;s infrastructure and set-up (since I am not a sponsored member of the Fedora system administration group).</p>
<p>My current two patches were submitted to my mentor, Patrick. Together, we worked through some small problems with running my playbook in the <a href="https://infrastructure.fedoraproject.org/cgit/ansible.git/">context of Fedora&rsquo;s infrastructure</a>. There may still be some small remaining hoops to jump through for running it in production, but any remaining changes to be made should be minor. The majority of the work and preparation for moving to production is complete. This is also something I plan to follow up on past the end of the GSoC 2016 program as a member of the Fedora <a href="https://fedoraproject.org/wiki/Infrastructure_Apprentice">Infrastructure Apprentice</a> program.</p>
<p>My patches should be merged into the <a href="https://infrastructure.fedoraproject.org/cgit/ansible.git/">ansible.git</a> and <a href="https://infrastructure.fedoraproject.org/cgit/infra-docs.git/">infra-docs.git</a> repositories soon.</p>

<h2 id="reflection-on-gsoc-2016">Reflection on GSoC 2016&nbsp;<a class="hanchor" href="#reflection-on-gsoc-2016" aria-label="Anchor link for: Reflection on GSoC 2016">🔗</a></h2>
<p>As the program comes to a close, there&rsquo;s a lot of valuable lessons I&rsquo;ve learned and opportunities I&rsquo;m thankful to have received. I want to share some of my own personal observations and thoughts in the hopes that future students or mentors might find it useful for later years.</p>

<h4 id="planning-your-timeline">Planning your timeline&nbsp;<a class="hanchor" href="#planning-your-timeline" aria-label="Anchor link for: Planning your timeline">🔗</a></h4>
<p>In my case, I spent a large amount of time <a href="https://fedoraproject.org/wiki/GSOC_2016/Student_Application_jflory7">planning my timeline</a> for the project before the summer. Once the summer began, my original timeline was too broad for having smaller milestones to work towards. My timeline on the student application was more broad and general, and while it covered the big points, it was difficult to work towards those at first. Creating smaller milestones and goals for the bigger tasks makes them easier to work through on a day-by-day basis and helps add a sense of accomplishment to the work you are doing. It also helps shape direction for your work in the short-term and not just the long-term.</p>
<p>For an incoming Google Summer of Code student for Fedora (or any project), I would recommend creating the general, &ldquo;big picture&rdquo; timeline for your project before the summer. Then, if you are accepted and beginning your proposal, spend a full day creating small milestones for the bigger items. Try to map out accomplishments every week and break down how you want to reach those milestones throughout the week. I started using <a href="https://taskwarrior.org/">TaskWarrior</a> with an <a href="https://inthe.am/about">Inthe.AM Taskserver</a> to help me manage weekly tasks going into my project. But it&rsquo;s important to find a tool that works for you. You should reach out to your mentor about ideas for tools. If possible, your mentor should also have a way to view your agenda and weekly tasks. This will help make sure your goals are aligned to the right kind of work you are doing for an on-time completion.</p>
<p>I think this kind of short-term planning or task management is essential for hitting the big milestones and being timely with your progress.</p>

<h4 id="regular-communication">Regular communication&nbsp;<a class="hanchor" href="#regular-communication" aria-label="Anchor link for: Regular communication">🔗</a></h4>
<p>Consistent and frequent communication is also essential for your success in Google Summer of Code. This can be different depending on the context of how you are contributing to the project. For a normal student, this might just be communicating about your proposal with your mentor regularly. If you&rsquo;re already an active contributor and working in other areas of the project, this might be spending extra time on communicating your progress on the GSoC project (but more on that specifically in the next section).</p>
<p>Regardless of the type of contributor you are, one thing is common and universal – <strong>be noisy</strong>! Ultimately, project mentors and GSoC program administrators want to be sure that you are spending the time on your project and making progress towards accomplishing your goals. If you are not communicating, you will run the highest risk of failing. How to communicate can vary from project to project, but for Fedora, here&rsquo;s my personal recommendations.</p>

<h6 id="blog-posts">Blog posts&nbsp;<a class="hanchor" href="#blog-posts" aria-label="Anchor link for: Blog posts">🔗</a></h6>
<p>Even for someone like me who spends a lot of time writing already, this can be a difficult thing to do. But no matter how hard it is to do it, this is the cornerstone for communicating your progress and leaving a trail for future students to learn from you as well. Even if you&rsquo;ve had a difficult week or haven&rsquo;t had much progress, take the time to sit down and write a post. If you&rsquo;re stuck, share your challenges and share what you&rsquo;re stuck on. Focus on any success or breakthroughs you&rsquo;ve made, but also reflect on issues or frustrations you have had.</p>
<p>Taking the time to reflect on triumphs and failures is important not only for Google Summer of Code, but even looking past that into the real world. Not everything will go your way and there will be times where you will be face challenges that you don&rsquo;t know how to resolve. Don&rsquo;t burn yourself out trying to solve those kinds of problems alone! Communicate about them, ask for help from your mentors and peers, and make it an open process.</p>

<h6 id="irc-check-ins">IRC check-ins&nbsp;<a class="hanchor" href="#irc-check-ins" aria-label="Anchor link for: IRC check-ins">🔗</a></h6>
<p>Whether in a public channel, a meeting, or a private one-on-one chat with your mentor, make sure you are both active and present in IRC. Make sure you are talking and communicating with your mentor on a regular basis (at a <em>minimum</em>, weekly). Taking the time to talk with your mentor about your challenges or progress is helpful for them so they know what you&rsquo;re up to or where you are in the project. It also provides a chance for them to offer advice and oversight into your direction and potentially steer you away from making a mistake or going into the wrong direction. It is demotivating when you&rsquo;ve spent a lot of time on something and then later discovered it either wasn&rsquo;t necessary or had a simpler solution than you realized.</p>
<p>Make sure you are communicating often with your mentor over IRC to make your progress transparent and to also offer the chance for you to avoid any pitfalls or traps that can be avoided.</p>

<h6 id="hang-out-in-the-development-channels">Hang out in the development channels&nbsp;<a class="hanchor" href="#hang-out-in-the-development-channels" aria-label="Anchor link for: Hang out in the development channels">🔗</a></h6>
<p>As a Fedora Google Summer of Code student, there are a few channels that you should be present in on a regular basis (a daily presence is best).</p>
<ul>
<li><code>#fedora-admin</code></li>
<li><code>#fedora-apps</code></li>
<li><code>#fedora-summer-coding</code></li>
<li>Any specific channel for your project, e.g. <code>#fedora-hubs</code></li>
</ul>
<p>A lot of development action happens in this channels, or people who can help you with problems are available here. This also provides you the opportunity to gain insight into what the communication in an active open source project looks like. You should at least be present and reading the activity in these channels during the summer. Participation is definitely encouraged as well.</p>

<h4 id="balancing-project-with-open-source-contributions">Balancing project with open source contributions&nbsp;<a class="hanchor" href="#balancing-project-with-open-source-contributions" aria-label="Anchor link for: Balancing project with open source contributions">🔗</a></h4>
<p>I think my single, most difficult challenge with Google Summer of Code was balancing my proposal-specific contributions with the rest of contributions and work in the Fedora Project. I believe I was a minority of Google Summer of Code students who applied for the program as an active member of the project <a href="https://jwfblog.wpenginepowered.com/2015/10/my-journey-into-fedora/">almost a full year</a> before the program began. Additionally, my areas of contribution in Fedora before GSoC were mostly unrelated to my project proposal. My project proposal mostly aligned with my <a href="http://nsa.rit.edu/">intended degree</a> and education I am pursuing. A lot of the technology I would be working with was new to me and I had minimal knowledge about it before beginning the summer. As a result, this presented a unique set of challenges and problems I would face throughout my project.</p>
<p>The consequences of this were that I had to spend a lot more time researching and becoming familiar with the technology before advancing with creating the deliverable items. A great resource for me to learn about Ansible was <a href="https://www.ansiblefordevops.com/"><em>Ansible for DevOps</em> by Jeff Geerling</a>. But I spent more time on learning and &ldquo;trying out the tech&rdquo; than I had anticipated.</p>
<p>This extra time spent on research and experimentation were in tandem to my ongoing contributions in other areas of the project like <a href="https://fedoraproject.org/wiki/CommOps">Community Operations</a>, <a href="https://fedoraproject.org/wiki/Marketing">Marketing</a>, <a href="https://fedoraproject.org/wiki/Ambassadors">Ambassadors</a>, the <a href="https://fedoraproject.org/wiki/Diversity">Diversity Team</a>, and as of recently, the <a href="https://fedoraproject.org/wiki/SIGs/Games">Games SIG</a>. Balancing my time between these different areas, including GSoC, was the biggest challenge to me over the summer (along with a separate, part-time job on weekends). A separation of time to different areas of Fedora became essential for making progress on my project. What worked well for me was setting short-term goals (by the hour or day) that I wanted to hit and carry out. Until those goals were reached, I wouldn&rsquo;t focus on anything other than those tasks.</p>

<h2 id="special-thanks">Special thanks&nbsp;<a class="hanchor" href="#special-thanks" aria-label="Anchor link for: Special thanks">🔗</a></h2>
<p>I&rsquo;m both thankful and grateful to those who have offered their mentorship, time, and guidance for me to be a member of the GSoC Class of 2016. Special thanks go to <a href="https://fedoraproject.org/wiki/User:Puiterwijk">Patrick Uiterwijk</a>, my mentor for the program. I&rsquo;ve learned a lot from Patrick through these past few months and enjoyed our conversations. Even though we were both running around the entire week, I&rsquo;m glad I had the chance to meet him at <a href="https://jwfblog.wpenginepowered.com/2016/08/fedora-flock-2016/">Flock 2016</a> (and hope to see him soon at <a href="https://fosdem.org/2017/">FOSDEM</a> or <a href="http://devconf.cz/">DevConf</a>)! Another thanks goes to one of my former supporting mentors and program administrator <a href="https://fedoraproject.org/wiki/User:Decause">Remy DeCausemaker</a>.</p>
<p>I&rsquo;m looking forward to another year and beyond of Fedora contributions, and can&rsquo;t wait to see what&rsquo;s next!</p>]]></description></item><item><title>Setting up Vagrant for testing Ansible</title><link>https://jwheel.org/blog/2016/06/setting-vagrant-testing-ansible/</link><pubDate>Fri, 10 Jun 2016 00:00:00 +0000</pubDate><guid>https://jwheel.org/blog/2016/06/setting-vagrant-testing-ansible/</guid><description><![CDATA[<p>As part of my <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> project proposal for the <a href="https://fedoraproject.org/wiki/Overview">Fedora Project</a>, I&rsquo;ve spent a lot of time learning about the ins and outs of Ansible. <a href="https://www.ansible.com/">Ansible</a> is a handy task and configuration automation utility. In the Fedora Project, Ansible is <a href="https://infrastructure.fedoraproject.org/cgit/ansible.git/">used extensively</a> in Fedora&rsquo;s infrastructure. But if you&rsquo;re first starting to learn Ansible, it might be tricky to test and play with it if you don&rsquo;t have production or development servers you can use. This is where Vagrant comes in.</p>

<h2 id="what-is-vagrant">What is Vagrant?&nbsp;<a class="hanchor" href="#what-is-vagrant" aria-label="Anchor link for: What is Vagrant?">🔗</a></h2>
<p>
<figure>
  <img src="/blog/2016/06/Vagrant.png" alt="Together, Vagrant and Ansible are a powerful combination." loading="lazy">
  <figcaption>Together, Vagrant and Ansible are a powerful combination.</figcaption>
</figure>
</p>
<p>Many people in the tech industry are already familiar with virtual machines (VMs) and using them for testing. If using a virtual machine is useful for testing and experimentation, Vagrant takes that idea and makes it a thousand times for powerful. <a href="https://www.vagrantup.com/">Vagrant</a> creates and configures a single virtual machine or several groups of inter-connected virtual machines. For someone trying to learn configuration management software like Ansible (or Puppet, or Chef, or Salt…), it features tight integration for creating virtual machines from playbooks.</p>
<p>Using Vagrant allows you to make quick, simple, and easy changes in a safe, local environment. Vagrant is also incredibly easy to set up, and in my experiences, it also ran well on a laptop. My trusty Toshiba Satellite with 8GB of RAM and an Intel i3 chip was able to handle three CentOS 7 virtual machines at once, and still manage to do other regular tasks.</p>

<h2 id="installing-vagrant-for-fedora">Installing Vagrant for Fedora&nbsp;<a class="hanchor" href="#installing-vagrant-for-fedora" aria-label="Anchor link for: Installing Vagrant for Fedora">🔗</a></h2>
<p>Since I&rsquo;m working with Fedora on my hardware while working on the Fedora Project over the summer, it would make sense for this guide to cover how to install and set up Vagrant inside of Fedora. However, I imagine it&rsquo;s similar for most other distributions, so try adapting these commands for your own distribution.</p>
<p>The Fedora repositories have a Vagrant package available. To install it, run the following command.</p>
<pre tabindex="0"><code>$ sudo dnf install vagrant
</code></pre><p>This will pull down Vagrant and all the dependencies it needs to run. However, what it won&rsquo;t do is pull down some of the many providers that it might need to use a virtual machine.</p>

<h3 id="vagrant-and-providers">Vagrant and providers&nbsp;<a class="hanchor" href="#vagrant-and-providers" aria-label="Anchor link for: Vagrant and providers">🔗</a></h3>
<p>For my testing, I used a <a href="https://atlas.hashicorp.com/geerlingguy/boxes/centos7">centos7 box image</a> from geerlingguy. This image creates a current, updated CentOS 7 virtual machine. In order to use it, you must have one of the two providers available: VMware or VirtualBox. Seeing as how VirtualBox is easier for me to install and use on my system, I chose to use VirtualBox as the &ldquo;provider&rdquo; for building and simulating the CentOS 7 box within Vagrant.</p>
<p>It took a bit of figuring out at first, but I found a current and well-documented <a href="http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-rhel/">guide</a> on how to install VirtualBox on to a Fedora 22 or 23 system. For a more detailed explanation of how to do it, you can read the <a href="http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-rhel/">instructions</a>, but for simplicity, I have the commands here to show how to add it to your Fedora system quickly.</p>
<pre tabindex="0"><code>$ sudo dnf upgrade
$ cd /etc/yum.repos.d/
$ sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
$ sudo dnf install VirtualBox-5.0 binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
$ sudo /usr/lib/virtualbox/vboxdrv.sh setup
$ sudo usermod -a -G vboxusers your_username
</code></pre><p>From here,  VirtualBox  will be available as a provider within Vagrant.</p>

<h2 id="running-a-centos-7-image">Running a CentOS 7 image&nbsp;<a class="hanchor" href="#running-a-centos-7-image" aria-label="Anchor link for: Running a CentOS 7 image">🔗</a></h2>
<p>Now that you have both Vagrant and VirtualBox installed, you can create a Vagrant virtual machine with this image. Navigate to a new directory you want to use for managing your virtual machines. Once there, you can use the following commands to start your CentOS 7 virtual machine.</p>
<pre tabindex="0"><code>$ vagrant box add geerlingguy/centos7
$ vagrant init geerlingguy/centos7
$ vagrant up --provider virtualbox
</code></pre><p>After a lot of downloading and then waiting for the first setup to finish, you should receive a notification that your virtual machine started! Huzzah! You can log in directly to it by typing <code>vagrant ssh</code> in the same directory you ran the above commands.</p>
<p>There&rsquo;s a lot of cool things you can do to set up your virtual machines and configure how they start. For example, you can choose to use the VirtualBox GUI for running your virtual machines if you don&rsquo;t want to SSH into it. You can tweak several different flags to alter the environment for the virtual machine. However, that is out of the scope of this guide, and there is a fair amount of documentation already online.</p>

<h2 id="provisioning-with-ansible">Provisioning with Ansible&nbsp;<a class="hanchor" href="#provisioning-with-ansible" aria-label="Anchor link for: Provisioning with Ansible">🔗</a></h2>
<p>The fun part (and what was really cool for me) was provisioning new virtual machines with Ansible. You can instruct Vagrant to seek an Ansible playbook when creating a new virtual machine. It will use the instructions of the playbook to configure, install, or tweak whatever is in the playbook, as if it&rsquo;s being run for the first time. Or maybe it&rsquo;s the second, the third, the fourth time you&rsquo;ve run it. In either case, the idempotent nature of Ansible should help make sure you avoid repeating anything that doesn&rsquo;t need repeating.</p>
<p>In order to tell Vagrant to search for an Ansible playbook, you will need to edit the <code>Vagrantfile</code> for wherever you initialized Vagrant. Open it up in your favorite text editor and add the following bits at the bottom, but before the final <code>end</code> statement.</p>
<pre tabindex="0"><code>config.vm.provision &#34;ansible&#34; do |ansible|
  ansible.playbook = &#34;playbook.yml&#34;
end
</code></pre><p>These short but sweet instructions tell Vagrant to look for a <code>playbook.yml</code> file when starting this virtual machine. It will then be easy to provision (i.e. configure / modify / change) the machine with your playbook later on.</p>

<h3 id="writing-the-playbook">Writing the playbook&nbsp;<a class="hanchor" href="#writing-the-playbook" aria-label="Anchor link for: Writing the playbook">🔗</a></h3>
<p>For this blog post, I&rsquo;ll offer a simple but clear example of a playbook you can use to start a Vagrant machine. This snippet specifically comes from <em><a href="http://www.ansiblefordevops.com/">Ansible for DevOps</a></em> by <a href="http://jeffgeerling.com/">Jeff Geerling</a>, which I have (and am) using as a guide as I continue to learn more about Ansible (I highly recommend the book, consider getting a copy).</p>
<pre tabindex="0"><code>---
- hosts: all
  sudo: yes
  tasks:
  - name: Ensure NTP (for time synchronization) is installed.
    yum: name=ntp state=present
  - name: Ensure NTP is running.
    service: name=ntpd state=started enabled=yes
</code></pre><p>All this example playbook does installs NTP if it is not present on the system, and then start and enable it, if it is not already. This is a very simple example, but it&rsquo;s good for getting started quickly.</p>

<h3 id="running-the-playbook">Running the playbook&nbsp;<a class="hanchor" href="#running-the-playbook" aria-label="Anchor link for: Running the playbook">🔗</a></h3>
<p>In the same directory as your <code>Vagrantfile</code>, create a <code>playbook.yml</code> with the above content. Once you have the YAML file there, running the following command will run the Ansible playbook and allow you to see how it runs.</p>
<pre tabindex="0"><code>$ vagrant provision
</code></pre><p>Now, Vagrant will take your playbook and instantly run it in your machine. If all goes right, your virtual machine will now have NTP installed and be syncing your clock to the Internet! While a simple task, it was a satisfying feeling for me to see this run, but also to imagine the other possibilities that this could be used for. It would be easy to run a playbook on one, two, ten, a hundred, a thousand servers, and have it do the same thing on all of them.</p>
<p>The automation was fascinating to me and began giving me ideas of how I could automate my infrastructure, as well as to creating one for WordPress (for my GSoC project).</p>
<p>Congratulations! By the end of this short but (hopefully) useful guide, you will have Vagrant virtual machines that are controlled and orchestrated by Ansible.</p>]]></description></item></channel></rss>