Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

[#98091344] Create Influxdb ansible role #1

Merged
merged 9 commits into from
Jul 8, 2015

Conversation

actionjack
Copy link
Contributor

Add metrics capture to core components

What

In preparation for load testing of our environment, we would like to capture metrics to evaluate how our systems are impacted.

The purpose of this PR is to create an InfluxDB time series database to store our metrics data.

How this PR should be reviewed

This PR has been created to be reviewed with the following narrative with non-breaking changes:

  • I want to create a Vagrant environment in order to test my code
  • I want to create a best practice ansible skeleton so I can write well structured ansible code
  • I want to ensure that the ansible-galaxy command can correctly parse my role's metadata
  • I want to setup some default variables for use in this role
  • I want to create some basic tasks in order to configure the influxdb service with a database for storing metrics
  • I want to create an administrative database account so that http based authentication can be enabled
  • I want to enable security so only admins can create and delete databases and users only have access to a single database
  • I want to tell people how to use this ansible role
  • I want to let people know that I have used a license that promotes code reuse

How to test this PR

The repository contains a Vagrant machine that can be used for testing by doing the following:

git clone git@github.com:alphagov/ansible-playbook-influxdb.git
cd ansible-playbook-influxdb
git checkout 98091344_create_influxdb_role
echo "influxdb_http_auth_enabled: 'true'" >> defaults/main.yml
vagrant up

Point your browser at http://localhost:8083/

  • Login as root with password root
  • confirm that a database called testdb exists and that someuser has been granted access to it

Known issues

All users appear to have admin permissions even when they are granted with limited access rights

Who can review this PR

  • Anyone on the core team can review this PR with the exception of @jimconner who I paired with :p

Create vagrant environment for local `influxdb ansible role`
development and testing.
Create default ansible role skeleton from template using
`ansible-galaxy init`
Adding the following default variables:

* `influxdb_version`: The version of `influxdb` to install.
* `influxdb_admin_user`: The administrator account for `influx_db`
* `influxdb_admin_password`: the password for `influxdb_admin_user`
  account.
* `influxdb_database`: Role will create a database of this name owned by
  `influxdb_user`.
* `influxdb_user`: A non-privliged database user account for
  `influxdb_database`.
* `influxdb_password`: the password for `influxdb_user` account.
@saliceti saliceti self-assigned this Jul 8, 2015
Create tasks to:

* Fetch influxdb installation package
* Install influxdb package
* Start influxdb service and ensure that it is enabled
* Waiting for influxdb service to become available
* Create influxdb database
* Create user for influxdb database
* Grant privileges to user for influxdb database
Create influxdb master admin account that can create, read, update and
delete other users and databases.
Make influxdb.conf a template so we can supply
`influxdb_http_auth_enabled` as a parameter to secure influxdb.
@saliceti
Copy link
Contributor

saliceti commented Jul 8, 2015

Tested successfully, merging.
Confirmed the security issue. Should be monitored closely.

saliceti added a commit that referenced this pull request Jul 8, 2015
[#98091344] Create Influxdb ansible role
@saliceti saliceti merged commit 2a9bdab into master Jul 8, 2015
@saliceti saliceti deleted the 98091344_create_influxdb_role branch July 8, 2015 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants