mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.6 KiB
ReStructuredText
61 lines
2.6 KiB
ReStructuredText
6 years ago
|
.. _OpenStack_module_development:
|
||
|
|
||
10 years ago
|
OpenStack Ansible Modules
|
||
|
=========================
|
||
|
|
||
|
These are a set of modules for interacting with OpenStack as either an admin
|
||
6 years ago
|
or an end user. If the module does not begin with ``os_``, it's either deprecated
|
||
10 years ago
|
or soon to be. This document serves as developer coding guidelines for
|
||
|
modules intended to be here.
|
||
|
|
||
6 years ago
|
.. contents::
|
||
|
:local:
|
||
|
|
||
10 years ago
|
Naming
|
||
|
------
|
||
|
|
||
6 years ago
|
* All module names should start with ``os_``
|
||
|
* Name any module that a cloud consumer would expect to use after the logical resource it manages: ``os_server`` not ``os_nova``. This naming convention acknowledges that the end user does not care which service manages the resource - that is a deployment detail. For example cloud consumers may not know whether their floating IPs are managed by Nova or Neutron.
|
||
|
* Name any module that a cloud admin would expect to use with the service and the resource: ``os_keystone_domain``.
|
||
10 years ago
|
* If the module is one that a cloud admin and a cloud consumer could both use,
|
||
|
the cloud consumer rules apply.
|
||
|
|
||
10 years ago
|
Interface
|
||
|
---------
|
||
|
|
||
|
* If the resource being managed has an id, it should be returned.
|
||
|
* If the resource being managed has an associated object more complex than
|
||
|
an id, it should also be returned.
|
||
|
|
||
10 years ago
|
Interoperability
|
||
|
----------------
|
||
|
|
||
|
* It should be assumed that the cloud consumer does not know a bazillion
|
||
|
details about the deployment choices their cloud provider made, and a best
|
||
6 years ago
|
effort should be made to present one sane interface to the Ansible user
|
||
10 years ago
|
regardless of deployer insanity.
|
||
|
* All modules should work appropriately against all existing known public
|
||
|
OpenStack clouds.
|
||
|
* It should be assumed that a user may have more than one cloud account that
|
||
6 years ago
|
they wish to combine as part of a single Ansible-managed infrastructure.
|
||
10 years ago
|
|
||
|
Libraries
|
||
|
---------
|
||
|
|
||
6 years ago
|
* All modules should use ``openstack_full_argument_spec`` to pick up the
|
||
10 years ago
|
standard input such as auth and ssl support.
|
||
6 years ago
|
* All modules should include ``extends_documentation_fragment: openstack``.
|
||
10 years ago
|
* All complex cloud interaction or interoperability code should be housed in
|
||
6 years ago
|
the `openstacksdk <http://git.openstack.org/cgit/openstack/openstacksdk>`_
|
||
7 years ago
|
library.
|
||
6 years ago
|
* All OpenStack API interactions should happen via the openstacksdk and not via
|
||
10 years ago
|
OpenStack Client libraries. The OpenStack Client libraries do no have end
|
||
6 years ago
|
users as a primary audience, they are for intra-server communication.
|
||
8 years ago
|
|
||
|
Testing
|
||
|
-------
|
||
|
|
||
6 years ago
|
* Integration testing is currently done in `OpenStack's CI system <https://git.openstack.org/cgit/openstack/openstacksdk/tree/openstack/tests/ansible>`_
|
||
6 years ago
|
* Testing in openstacksdk produces an obvious chicken-and-egg scenario. Work is under
|
||
8 years ago
|
way to trigger from and report on PRs directly.
|