1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Tidying of webfaction modules

This commit is contained in:
Quentin Stafford-Fraser 2015-05-03 23:48:51 +01:00 committed by Matt Clay
parent 00e146649f
commit 3f715dc954
5 changed files with 23 additions and 30 deletions

View file

@ -13,7 +13,7 @@ short_description: Add or remove applications on a Webfaction host
description:
- Add or remove applications on a Webfaction host. Further documentation at http://github.com/quentinsf/ansible-webfaction.
author: Quentin Stafford-Fraser
version_added: 1.99
version_added: 2.0
notes:
- "You can run playbooks that use this on a local machine, or on a Webfaction host, or elsewhere, since the scripts use the remote webfaction API - the location is not important. However, running them on multiple hosts I(simultaneously) is best avoided. If you don't specify I(localhost) as your host, you may want to add C(serial: 1) to the plays."
- See `the webfaction API <http://docs.webfaction.com/xmlrpc-api/>`_ for more info.
@ -23,7 +23,6 @@ options:
description:
- The name of the application
required: true
default: null
state:
description:
@ -65,7 +64,6 @@ options:
'''
import xmlrpclib
from ansible.module_utils.basic import *
webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ -73,12 +71,12 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True, default=None),
name = dict(required=True),
state = dict(required=False, default='present'),
type = dict(required=True),
autostart = dict(required=False, choices=BOOLEANS, default='false'),
autostart = dict(required=False, choices=BOOLEANS, default=False),
extra_info = dict(required=False, default=""),
port_open = dict(required=False, default="false"),
port_open = dict(required=False, choices=BOOLEANS, default=False),
login_name = dict(required=True),
login_password = dict(required=True),
),
@ -148,6 +146,6 @@ def main():
result = result
)
# The conventional ending
from ansible.module_utils.basic import *
main()

View file

@ -10,7 +10,7 @@ short_description: Add or remove a database on Webfaction
description:
- Add or remove a database on a Webfaction host. Further documentation at http://github.com/quentinsf/ansible-webfaction.
author: Quentin Stafford-Fraser
version_added: 1.99
version_added: 2.0
notes:
- "You can run playbooks that use this on a local machine, or on a Webfaction host, or elsewhere, since the scripts use the remote webfaction API - the location is not important. However, running them on multiple hosts I(simultaneously) is best avoided. If you don't specify I(localhost) as your host, you may want to add C(serial: 1) to the plays."
- See `the webfaction API <http://docs.webfaction.com/xmlrpc-api/>`_ for more info.
@ -20,7 +20,6 @@ options:
description:
- The name of the database
required: true
default: null
state:
description:
@ -61,7 +60,6 @@ EXAMPLES = '''
import socket
import xmlrpclib
from ansible.module_utils.basic import *
webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ -69,10 +67,10 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True, default=None),
name = dict(required=True),
state = dict(required=False, default='present'),
# You can specify an IP address or hostname.
type = dict(required=True, default=None),
type = dict(required=True),
password = dict(required=False, default=None),
login_name = dict(required=True),
login_password = dict(required=True),
@ -142,6 +140,6 @@ def main():
result = result
)
# The conventional ending
from ansible.module_utils.basic import *
main()

View file

@ -10,7 +10,7 @@ short_description: Add or remove domains and subdomains on Webfaction
description:
- Add or remove domains or subdomains on a Webfaction host. Further documentation at http://github.com/quentinsf/ansible-webfaction.
author: Quentin Stafford-Fraser
version_added: 1.99
version_added: 2.0
notes:
- If you are I(deleting) domains by using C(state=absent), then note that if you specify subdomains, just those particular subdomains will be deleted. If you don't specify subdomains, the domain will be deleted.
- "You can run playbooks that use this on a local machine, or on a Webfaction host, or elsewhere, since the scripts use the remote webfaction API - the location is not important. However, running them on multiple hosts I(simultaneously) is best avoided. If you don't specify I(localhost) as your host, you may want to add C(serial: 1) to the plays."
@ -22,7 +22,6 @@ options:
description:
- The name of the domain
required: true
default: null
state:
description:
@ -50,7 +49,6 @@ options:
import socket
import xmlrpclib
from ansible.module_utils.basic import *
webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ -58,7 +56,7 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True, default=None),
name = dict(required=True),
state = dict(required=False, default='present'),
subdomains = dict(required=False, default=[]),
login_name = dict(required=True),
@ -129,6 +127,6 @@ def main():
result = result
)
# The conventional ending
from ansible.module_utils.basic import *
main()

View file

@ -10,7 +10,7 @@ short_description: Add or remove mailboxes on Webfaction
description:
- Add or remove mailboxes on a Webfaction account. Further documentation at http://github.com/quentinsf/ansible-webfaction.
author: Quentin Stafford-Fraser
version_added: 1.99
version_added: 2.0
notes:
- "You can run playbooks that use this on a local machine, or on a Webfaction host, or elsewhere, since the scripts use the remote webfaction API - the location is not important. However, running them on multiple hosts I(simultaneously) is best avoided. If you don't specify I(localhost) as your host, you may want to add C(serial: 1) to the plays."
- See `the webfaction API <http://docs.webfaction.com/xmlrpc-api/>`_ for more info.
@ -20,7 +20,6 @@ options:
description:
- The name of the mailbox
required: true
default: null
mailbox_password:
description:
@ -48,7 +47,6 @@ options:
import socket
import xmlrpclib
from ansible.module_utils.basic import *
webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ -56,7 +54,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
mailbox_name=dict(required=True, default=None),
mailbox_name=dict(required=True),
mailbox_password=dict(required=True),
state=dict(required=False, default='present'),
login_name=dict(required=True),
@ -107,6 +105,7 @@ def main():
module.exit_json(changed=True, result=result)
# The conventional ending
from ansible.module_utils.basic import *
main()

View file

@ -10,7 +10,7 @@ short_description: Add or remove a website on a Webfaction host
description:
- Add or remove a website on a Webfaction host. Further documentation at http://github.com/quentinsf/ansible-webfaction.
author: Quentin Stafford-Fraser
version_added: 1.99
version_added: 2.0
notes:
- Sadly, you I(do) need to know your webfaction hostname for the C(host) parameter. But at least, unlike the API, you don't need to know the IP address - you can use a DNS name.
- If a site of the same name exists in the account but on a different host, the operation will exit.
@ -23,7 +23,6 @@ options:
description:
- The name of the website
required: true
default: null
state:
description:
@ -83,7 +82,6 @@ EXAMPLES = '''
import socket
import xmlrpclib
from ansible.module_utils.basic import *
webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ -91,11 +89,11 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True, default=None),
name = dict(required=True),
state = dict(required=False, default='present'),
# You can specify an IP address or hostname.
host = dict(required=True, default=None),
https = dict(required=False, choices=BOOLEANS, default='false'),
host = dict(required=True),
https = dict(required=False, choices=BOOLEANS, default=False),
subdomains = dict(required=False, default=[]),
site_apps = dict(required=False, default=[]),
login_name = dict(required=True),
@ -184,6 +182,8 @@ def main():
result = result
)
# The conventional ending
from ansible.module_utils.basic import *
main()