Tech
My ISP is less than reliable so I decided to automate my modem restarts. I’m using a Motorola SB6141 and I can access a web based interface at 192.168.100.1.
Using a combination of curl, grep, and sed, I was able to scrape the necessary pages to get information about the modem’s status. The script then checks the status and restarts the modem if it detects a fault. The script uses curl to GET a specific URL with the necessary parameters. This GET request triggers the modem’s restart.
In this third installment of my No Hassle Blog Automation series, I remove the necessity for running any infrastructure of my own. Drone has been replaced with a hosted solution at CircleCI . Their support is amazing, and their circle.yml format made configuration easy. Take a look at the first and second installments of this series.
Requirements
There are a few requirements for this setup:
- Rackspace Cloud Account
- Cloud Files Container*
- Existing Pelican Blog
- GitHub Account
* This container should be configured to serve a static site .
Due to the difficulty in maintaining a full Jenkins instance, I have revisited the blog automation issue and have replaced Jenkins with Drone. Making use of a tool like Drone greatly simplifies the setup process and lowers the barrier of entry for this type of project.
Requirements
There are a few requirements for this setup:
- Rackspace Cloud Account
- Existing Pelican Blog
- GitHub Account
- Linux Administration Knowledge
You should also read my original article .
Deploying Ansible Tower isn’t hard, but automating a server build and triggering the installation lowers the barrier of entry for trying out Tower. This article will describe the HEAT Template I’ve created to automate this process.
Anatomy of a HEAT Template
Templates are broken into several main sections. I’m going to describe each one of them so you fully understand the process. Follow along here: Ansible Tower HEAT Template
Description and Version
It is important that the Version information you specify matches the HEAT version in use. The description should describe the overall goal of the template.
Installing
Installing inventory plugins isn’t intuitive, and the documentation available on this process isn’t immediately clear. The instructions found on this page Ansible Documentation can be adapted for the Rackspace plugin.
It boils down to this for the Rackspace plugin:
- Grab the latest version of rax.py from the plugins/inventory folder on GitHub. Raw GitHub Link
- Place this file on your Ansible master. The location doesn’t matter that much, but convention says to put it in /etc/ansible/rax.py.
- Make this script executable by issuing chmod +x /etc/ansible/rax.py.
- As the user that runs Ansible, create the following file at ~/.rackspace_cloud_credentials: (Be sure to replace the appropriate values with your Rackspace username and apikey.)
[rackspace_cloud]
username = my_username
api_key = 01234567890abcdef
Target the rax.py script in your ansible run: ansible -i /etc/ansible/rax.py webserver -m ping