Skip to content

Commit

Permalink
module guideline changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramondelafuente authored and mattclay committed Dec 8, 2016
1 parent c0b6906 commit 79352b5
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions lib/ansible/modules/extras/web_infrastructure/deploy_helper.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# (c) 2014, Jasper N. Brouwer <[email protected]>
# (c) 2014, Ramon de la Fuente <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

DOCUMENTATION = '''
---
module: deploy_helper
version_added: "1.8"
author: Ramon de la Fuente, Jasper N. Brouwer
version_added: "2.0"
author: "Ramon de la Fuente (@ramondelafuente)"
short_description: Manages some of the steps common in deploying projects.
description:
- The Deploy Helper manages some of the steps common in deploying software.
Expand All @@ -23,14 +42,14 @@
options:
path:
required: true
required: True
aliases: ['dest']
description:
- the root path of the project. Alias I(dest).
Returned in the C(deploy_helper.project_path) fact.
state:
required: false
required: False
choices: [ present, finalize, absent, clean, query ]
default: present
description:
Expand All @@ -43,50 +62,51 @@
C(absent) will remove the project folder (synonymous to the M(file) module with C(state=absent))
release:
required: false
required: False
default: None
description:
- the release version that is being deployed. Defaults to a timestamp format %Y%m%d%H%M%S (i.e. '20141119223359').
This parameter is optional during C(state=present), but needs to be set explicitly for C(state=finalize).
You can use the generated fact C(release={{ deploy_helper.new_release }}).
releases_path:
required: false
required: False
default: releases
description:
- the name of the folder that will hold the releases. This can be relative to C(path) or absolute.
Returned in the C(deploy_helper.releases_path) fact.
shared_path:
required: false
required: False
default: shared
description:
- the name of the folder that will hold the shared resources. This can be relative to C(path) or absolute.
If this is set to an empty string, no shared folder will be created.
Returned in the C(deploy_helper.shared_path) fact.
current_path:
required: false
required: False
default: current
description:
- the name of the symlink that is created when the deploy is finalized. Used in C(finalize) and C(clean).
Returned in the C(deploy_helper.current_path) fact.
unfinished_filename:
required: false
required: False
default: DEPLOY_UNFINISHED
description:
- the name of the file that indicates a deploy has not finished. All folders in the releases_path that
contain this file will be deleted on C(state=finalize) with clean=True, or C(state=clean). This file is
automatically deleted from the I(new_release_path) during C(state=finalize).
clean:
required: false
required: False
default: True
description:
- Whether to run the clean procedure in case of C(state=finalize).
keep_releases:
required: false
required: False
default: 5
description:
- the number of old releases to keep when cleaning. Used in C(finalize) and C(clean). Any unfinished builds
Expand Down Expand Up @@ -352,7 +372,7 @@ def main():
module = AnsibleModule(
argument_spec = dict(
path = dict(aliases=['dest'], required=True, type='str'),
release = dict(required=False, type='str', default=''),
release = dict(required=False, type='str', default=None),
releases_path = dict(required=False, type='str', default='releases'),
shared_path = dict(required=False, type='str', default='shared'),
current_path = dict(required=False, type='str', default='current'),
Expand Down Expand Up @@ -418,4 +438,5 @@ def main():
# import module snippets
from ansible.module_utils.basic import *

main()
if __name__ == '__main__':
main()

0 comments on commit 79352b5

Please sign in to comment.