Writing A New Puppet OpenStack Module Like A Rockstar Emilien Macchi Software Engineer @ Red Hat OpenStack Summit - Barcelona 2016
Agenda ● Puppet OpenStack project ● How to contribute ● Building a new module ● Get our hands dirty! ● Questions
Puppet OpenStack project
OpenStack is (very) complex to deploy. Source: docs.openstack.org
This happens when you deploy OpenStack without automation tools...
?
“The Puppet modules for OpenStack bring scalable and reliable IT automation to OpenStack cloud deployments.” Source: OpenStack governance
Puppetize OpenStack openstacklib Barbican Ceilometer Cinder Gnocchi Designate openstack_extras Glance Heat Horizon Ironic apache firewall Aodh Magnum Manila Mistral Cloudkitty python Neutron Nova Murano Rally apt corosync Panko Sahara Congress Watcher Swift memcached Tempest Trove Zaqar ntp inifile Keystone concat sysctl MySQL RabbitMQ Source: Puppetconf talk with Colleen Murphy
Puppet module composition ● Manage Keystone resources (endpoints, service) Manage database(s) (MySQL or PostgreSQL) ● ● Manage service(s) configuration: ○ Oslo sections Keystone section ○ ○ Specific to the service API service under WSGI with Apache ● ● Manage all other services ● Highly composable and documented
Example include ::mysql include ::keystone include ::keystone::wsgi::apache include ::keystone::roles::admin
Testing ● Unit tests (RSpec) ● Beaker tests ● Integration tests ● OpenStack installers: ○ TripleO ○ Fuel
How to contribute
Multiple ways to help ● Give feedback (IRC, e-mails, Launchpad) ● Write code: bugfix, features ● Improve documentation ● Increase testing coverage ● Help in troubleshooting (IRC, e-mails) ● ...
Contribute to Puppet OpenStack ● Join us on IRC (#puppet-openstack on freenode) ● Setup your OpenStack account ○ http://docs.openstack.org/infra/manual/developers.html ● Subscribe to openstack-dev mailing-list, [puppet] tag ● Participate to weekly meetings ● Report bugs on Launchpad
Building a new module
Don’t create the module on your own Github.
Steps ● Check if module already exists Communicate about this new module (IRC, e-mail) ● ● Add project to openstack/governance and openstack-infra/project-config ● Run cookiecutter to generate the Puppet module ● Services adjustments Deploy! ● docs.openstack.org/developer/puppet-openstack-guide/new-module.html
Cookiecutter Generate Adjust module with Review process manifests script Clone cookiecutter Change ports Require Gerrit ● ● ● ● Run script ● Adjust service name account ● First iteration of module
Anatomy of a generated Puppet module ● Manifest to deploy Keystone resources Manifest to deploy databases (MySQL and PostgreSQL) ● ● Manifest to configure logging ● Basic structure for unit and functional tests ● Reno support (release notes) Puppet dependencies (Gemfile, Rakefile, spec_helper, metadata.json, etc) ●
Demo
Thank you :-) emilien@redhat.com
Recommend
More recommend