Server automation, part 0

My infrastructure is slowly getting bigger, in spite of everything I do. I decided to research the current CI tools to decide what would be useful to use and what a potential employer would find useful. I’m trying to avoid learning another language. Puppet and Chef were ideas I was considering, but the need to become familiar with another language (Ruby) made me look at other options. On the other hand, I need to relearn Ruby anyways if I’m going to use Capistrano for deployment to remote servers. One thing at a time.

So far, I’m going round and round with Ansible and Salt, both in the Python universe. I’ve also run across something called StackStorm, which could be a possibility. (IFTTT for servers OR “event-driven automation”.) I’ll need to look at that another time to make valid decisions about that.

So far, it looks like Ansible would be easier to use, except for one issue. I’m still unclear if Ansible is useful with Python 3. I know that Ansible 2.2+ does run with Python 3, but it’s unclear if any related Ansible modules I might use are also compatible with Python 3.

I should probably try out at least two applications. For now, I’m going to try out Ansible.

Advertisements

So I decided to install Java …

I’m not a Java coder. I work primarily in PHP, with Python on the side. I’ve been rewriting an old PHP project to conform with modern standards, including testing. I decided to use Codeception for PHP testing, mainly because it looked like PHPUnit was included and unit/integration/acceptance testing looked easy (if you follow the example given in the website). I had used Gherkin to write BDD tests, so I was happy to see it with PHP. I also saw auto-testing with PhpBrowser and … Selenium!

I had used Selenium for testing several years ago. I remembered that all I had to do was fire up the Selenium server and run the tests to catch any Javascript browser issues. I remember that being very helpful, so I downloaded the Selenium server and tried to fire it up. … Wait a minute. I don’t have java on this machine any more? The OS upgrades probably turned it to toast. OK. I’ll install that first.

I spent a few days thinking about how to install it. Since I use brew to install other command-line applications, I wondered how brew would handle a JDK installation. It turns out that my Google search: “jdk homebrew” came up with several web pages that did not fully work. I had to put together instructions from these pages.

For starters, I ran into a command that mentioned casks. Eventually, after another Google search (“homebrew install cask”), I discovered that “cask” is a way of managing graphical applications through brew. Anyway, after some review, I finally have Java (1.8.0_131) running on my El Cap box. Yay, me! You’re welcome to try these or to review the pages linked above to figure out yourself. It looks like it will work either way.

brew update
> brew install caskroom/cask/brew-cask  …  (probably did nothing)
> brew tap caskroom/cask
> brew cask install java

Note that I did not choose to install “jenv”, which creates virtual environments similar to “virtualenv” or “venv” (?) with Python. Somewhere in one of these pages, there was a note that I needed to install Java 7 first. I never found a reason why it was needed, so I skipped it. We’ll see if I do need it.