All Projects → nvogel → Puppet Ansible

nvogel / Puppet Ansible

Licence: mit
Deploy Ansible with puppet

Labels

Projects that are alternatives of or similar to Puppet Ansible

Stingray Puppet
Puppet module to control Riverbed Stingray Traffic Manager
Stars: ✭ 8 (-42.86%)
Mutual labels:  puppet
Puppet Rails
A Puppet module for managing rails
Stars: ✭ 10 (-28.57%)
Mutual labels:  puppet
Runyer
Stars: ✭ 12 (-14.29%)
Mutual labels:  puppet
Aco Tomcat
Puppet module for Tomcat
Stars: ✭ 9 (-35.71%)
Mutual labels:  puppet
Nodejs Vagrantbox
Simple nodejs box vagrant configuration (trusty64, nodejs, git, bower...)
Stars: ✭ 10 (-28.57%)
Mutual labels:  puppet
Puppet Phpbrew
Puppet module for phpbrew.
Stars: ✭ 11 (-21.43%)
Mutual labels:  puppet
Windows sql
Puppet Module wich allow you to install and configure SQL Server on windows server 2012 or newer
Stars: ✭ 8 (-42.86%)
Mutual labels:  puppet
Fuel Plugin Detach Rabbitmq
MOVED: now at https://opendev.org/x/fuel-plugin-detach-rabbitmq
Stars: ✭ 14 (+0%)
Mutual labels:  puppet
Selenium Puppet
a puppet module for installing the selenium server and selenium-webdriver gem
Stars: ✭ 10 (-28.57%)
Mutual labels:  puppet
Monarch
Rule over hierarchical data!
Stars: ✭ 12 (-14.29%)
Mutual labels:  puppet
Puppet Postgres Hardening
Postgres Web Server Hardening with Puppet
Stars: ✭ 9 (-35.71%)
Mutual labels:  puppet
Ll
LL - Object-Oriented Scheme Implementation
Stars: ✭ 9 (-35.71%)
Mutual labels:  puppet
Puppet Bro
Puppet module to manage Bro NSM
Stars: ✭ 11 (-21.43%)
Mutual labels:  puppet
Puppet Etcd
etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.
Stars: ✭ 9 (-35.71%)
Mutual labels:  puppet
Puppet Cassandra
Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.
Stars: ✭ 13 (-7.14%)
Mutual labels:  puppet
Aws Tilemill
Stars: ✭ 8 (-42.86%)
Mutual labels:  puppet
Puppet Cloudwatchlogs
Puppet module for configuring AWS Cloudwatch Logs on Amazon Linux, Ubuntu, Red Hat & CentOS EC2 instances.
Stars: ✭ 11 (-21.43%)
Mutual labels:  puppet
Puppet Autossh
MOVED: now at https://opendev.org/x/puppet-autossh
Stars: ✭ 14 (+0%)
Mutual labels:  puppet
Puppet Syncthing
Syncthing module for Puppet
Stars: ✭ 13 (-7.14%)
Mutual labels:  puppet
Puppet Django
a puppet module for deploying django - pythonbrew - supervisor - gunicorn install
Stars: ✭ 11 (-21.43%)
Mutual labels:  puppet

Ansible puppet module

puppet forge version last tag

When puppet and ansible work together for better orchestration

Definitions

In the following :

  • the Ansible master is the host where Ansible is installed and where you run your playbooks
  • the Ansible nodes are the hosts managed by the ansible master

Description

The goals of the ansible puppet module are :

  • installing Ansible on the ansible master
  • allowing ssh connections from the ansible master to a pool of ansible nodes
  • creating an ansible user on all hosts (master and nodes)
  • allowing the ansible user to run command as root with sudo

The module use public key authentication and manage the /etc/ssh/ssh_known_hosts file of the ansible master.

Requirements

A puppet master with "storeconfigs" enabled, because this module uses exported ressources.

This module is created for Debian (Squeeze/Wheezy) and compatible with puppet agent (> 2.7).

This module use puppetlabs-stdlib (> 4.2.2).

The module has been tested on:

  • Debian 6
  • Debian 7

This module could be used on Ubuntu or CentOs (actually Debian and RedHat operating system family), but tests has been light and support cannot be guaranteed.

Installation and upgrade

puppet forge version last tag

From the forge, go to nvogel/ansible

Or with Librarian puppet, for example add to your Puppetfile :

  mod 'ansible',
    :git => 'https://github.com/nvogel/puppet-ansible',
    :ref => '3.0.0'

Each version number follows the rules defined by semantic versioning.

You should read the changelog file before upgrading to a new version and use only a tagged version.

How to use the puppet ansible module

Deploy ansible

Puppet side

Imagine you want to install Ansible on a host named master.fqdn.tld.

You can use hiera, an enc, or a plain text manifest.

You can have several ansible master hosts, each one will have its own pool of ansible nodes.

You have to make 2 runs of the puppet agent to complete the configuration process.

Ansible is installed by default with pip.

You can also use the default package provider of the platform, in this case you may have to enable a specific repository where you can find the ansible package (for example wheezy-backport or epel).

Plain text manifest

For the master node :

include ansible

or

class { 'ansible':
  ensure => master
}

or if you want to use the default (apt/yum) provider

include { 'ansible::master':
  provider => automatic
}

For each ansible node :

class { 'ansible':
  ensure => node,
  master => 'master.fqdn.tld'
}

or

class { 'ansible::node' :
  master  => 'master.fqdn.tld'
}
Hiera

Example with a pool of hosts named pool1.

Each host have the same value for the fact pool.

There is one host in the pool which is the ansible master (master.fqdn.tld).

hiera.yaml :

---
:backends:
  - yaml
:yaml:
  :datadir: /etc/puppet/%{environment}/hieradata
:hierarchy:
  - "node/%{::clientcert}"
  - "pool/%{::pool}"
  - common

hieradata directory :

hieradata/
├── pool
│   └── pool1.yaml
└── node
    └── master.fqdn.tld.yaml

pool1.yaml :

---
classes: ansible
ansible::ensure: node
ansible::master: master.fqdn.tld

master.fqdn.tld.yaml :

---
ansible::ensure: master
ansible::master: false

Ansible side

On the ansible master host, all you have to do is to use the ansible user. By default, the ansible user is set with a non valid password so you have to be root to use this account.

su - ansible

On the ansible nodes, the only package installed is sudo. So, you may have to deploy additional python packages which are required for some ansible modules.

Upgrade ansible

By default, puppet install the current version of ansible but will not upgrade it if already present.

You can change ansible version by setting the ansible::install::version parameter.

Example with hiera :

Latest version with apt

---
ansible::ensure: master
ansible::master: false
ansible::master::provider: automatic
ansible::install::version: latest

Specific version with pip

---
ansible::ensure: master
ansible::master: false
ansible::install::version: "1.8.2"

Manage playbooks

You can define a directory owned by the user ansible where you can store your playbooks (by default /etc/ansible).

For examples:

---
classes: ansible::playbooks
ansible::ensure: master
ansible::master: false

or

include ansible::playbooks

Development

Contributing

You're welcome to propose enhancements or submit bug reports (even typos).

When you perform modifications inside the puppet module :

  • You MUST run the test suite (see Testing section)
  • You MUST write (or update) the test suite
  • You MUST update the documentation

Thanks in advance.

Branch management

  • Build status on branch master : Build Status
  • Build status on release 3.0.0 : Build Status
  • Build status on release 2.1.0 : Build Status
  • Build status on release 2.0.1 : Build Status
  • Build status on release 2.0.0 : Build Status
  • Build status on release 1.1.1 : Build Status
  • Build status on release 1.1.0 : Build Status
  • Build status on release 1.0.0 : Build Status

The master branch corresponds to the release under development. Could be unstable. All stable release are tagged.

Installation

gem install bundler
mkdir modules
cd modules
git clone git://github.com/nvogel/puppet-ansible.git ansible
cd ansible
bundle install --path vendor/bundle

Testing

How to list the available tasks

bundle exec rake

How to run syntax, lint and rspec

bundle exec rake test

How to check the syntax

bundle exec rake syntax

How to lint

bundle exec rake lint

How to run rspec on the manifests

bundle exec rake spec

How to run test automatically when you change any of the manifest

bundle exec guard

Documentation

How to generate the documentation of the module

mkdir -p /tmp/doc/ansible && touch /tmp/doc/manifest
cd /path/to/module/directory/ansible
ln -s "$(pwd)/lib" /tmp/doc/ansible
ln -s "$(pwd)/manifests" /tmp/doc/ansible
#generate module documentation in /path/to/ansible_doc from /tmp/doc
bundle exec puppet doc --charset UTF-8 --outputdir /path/to/ansible_doc --mode rdoc --manifest /tmp/doc/manifest --modulepath /tmp/doc

Credits

Licence

Puppet ansible module is released under the MIT License. Check the LICENSE file for details.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].