Skip to content

Instantly share code, notes, and snippets.

@cloudnull
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudnull/75343334426a96e30156 to your computer and use it in GitHub Desktop.
Save cloudnull/75343334426a96e30156 to your computer and use it in GitHub Desktop.
Update roles for galaxy compatibility

Overview

All of our roles should be galaxy compatible and generally deployable on their own. To do this the roles need to have a few bits added to them and consolidated where it makes.

Problem Description

Presently none of our roles are able to be updated to Ansible Galaxy. This should a capability of our deployment system.

Proposed Change

Some of this work has been done here: https://github.com/cloudnull/os-lxc-hosts

In all of our roles we should have, at a minimum, the meta/main.yml file which provides for ansible-galaxy information and any relevant dependencies.

Example meta file:
galaxy_info:
  author: rcbops
  description: Installation galera server
  company: Rackspace
  license: Apache2
  min_ansible_version: 1.6.6
  platforms:
    - name: Ubuntu
      versions:
        - trusty
  categories:
    - cloud
    - galera
    - mariadb
    - development
    - openstack
    - rpc
dependencies: [ "galera_client" ]

As the roles are being built out for galaxy compatibility they should also have tags created for tasks where appropriate. More information on galaxy roles, https://galaxy.ansible.com/intro

Notable changes:
  • Further improvements should also be made to the role in regards to the default options that are presnetly being set in inventory/group_vars/*
  • Some plays will need to be refactored for default variables.
  • Some roles should simply be moved into pre_tasks in other playbooks.

Playbook Impact

A few playbooks may need to be adjusted for some of the new roles however most of the top level playbooks should be largely unchanged.

Alternatives

Leave all of the roles the way they are, which makes us galaxy incompatible.

Security Impact

None

Performance Impact

While its tough to say what the performance impact would be I would estimate that we could improve deployment performance by simply removing unnecessary roles and building proper role dependencies.

End User Impact

None

Deployer Impact

Faster deployment, and more compatibility in Ansible's existing tooling.

Developer Impact

This should put us on a better path with regard to how we develop future roles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment