Skip to content

Commit

Permalink
Rename modules from plural to singular (ansible#27185)
Browse files Browse the repository at this point in the history
* First batch of modules renamed from plural to singular

Related to this proposal: ansible/proposals#10

* Emit rename deprication warning

* Update legacy-files.txt and skip.txt to reflect new names
  • Loading branch information
samdoran authored Aug 14, 2017
1 parent 9d84a4e commit 6806000
Show file tree
Hide file tree
Showing 32 changed files with 144 additions and 71 deletions.
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/amazon/_ec2_vpc_dhcp_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

DOCUMENTATION = """
---
module: ec2_vpc_dhcp_options
module: ec2_vpc_dhcp_option
short_description: Manages DHCP Options, and can ensure the DHCP options for the given VPC match what's
requested
description:
Expand Down Expand Up @@ -140,7 +140,7 @@
EXAMPLES = """
# Completely overrides the VPC DHCP options associated with VPC vpc-123456 and deletes any existing
# DHCP option set that may have been attached to that VPC.
- ec2_vpc_dhcp_options:
- ec2_vpc_dhcp_option:
domain_name: "foo.example.com"
region: us-east-1
dns_servers:
Expand All @@ -160,7 +160,7 @@
# Ensure the DHCP option set for the VPC has 10.0.0.4 and 10.0.1.4 as the specified DNS servers, but
# keep any other existing settings. Also, keep the old DHCP option set around.
- ec2_vpc_dhcp_options:
- ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- "{{groups['dns-primary']}}"
Expand All @@ -172,7 +172,7 @@
## Create a DHCP option set with 4.4.4.4 and 8.8.8.8 as the specified DNS servers, with tags
## but do not assign to a VPC
- ec2_vpc_dhcp_options:
- ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- 4.4.4.4
Expand All @@ -182,7 +182,7 @@
Environment: Test
## Delete a DHCP options set that matches the tags and options specified
- ec2_vpc_dhcp_options:
- ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- 4.4.4.4
Expand All @@ -193,7 +193,7 @@
state: absent
## Associate a DHCP options set with a VPC by ID
- ec2_vpc_dhcp_options:
- ec2_vpc_dhcp_option:
region: us-east-1
dhcp_options_id: dopt-12345678
vpc_id: vpc-123456
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

DOCUMENTATION = '''
---
module: ec2_vpc_dhcp_options_facts
module: ec2_vpc_dhcp_option_facts
short_description: Gather facts about dhcp options sets in AWS
description:
- Gather facts about dhcp options sets in AWS
Expand Down Expand Up @@ -43,21 +43,21 @@
# # Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Gather facts about all DHCP Option sets for an account or profile
ec2_vpc_dhcp_options_facts:
ec2_vpc_dhcp_option_facts:
region: ap-southeast-2
profile: production
register: dhcp_facts
- name: Gather facts about a filtered list of DHCP Option sets
ec2_vpc_dhcp_options_facts:
ec2_vpc_dhcp_option_facts:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "abc-123"
register: dhcp_facts
- name: Gather facts about a specific DHCP Option set by DhcpOptionId
ec2_vpc_dhcp_options_facts:
ec2_vpc_dhcp_option_facts:
region: ap-southeast-2
profile: production
DhcpOptionsIds: dopt-123fece2
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/openstack/_os_server_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

DOCUMENTATION = '''
---
module: os_server_actions
module: os_server_action
short_description: Perform actions on Compute Instances from OpenStack
extends_documentation_fragment: openstack
version_added: "2.0"
Expand Down Expand Up @@ -71,15 +71,15 @@

EXAMPLES = '''
# Pauses a compute instance
- os_server_actions:
action: pause
auth:
auth_url: https://mycloud.openstack.blueboxgrid.com:5001/v2.0
username: admin
password: admin
project_name: admin
server: vm1
timeout: 200
- os_server_action:
action: pause
auth:
auth_url: https://mycloud.openstack.blueboxgrid.com:5001/v2.0
username: admin
password: admin
project_name: admin
server: vm1
timeout: 200
'''

try:
Expand Down Expand Up @@ -142,6 +142,9 @@ def main():
required_if=[('action', 'rebuild', ['image'])],
**module_kwargs)

if module._name == 'os_server_actions':
module.deprecate("The 'os_server_actions' module is being renamed 'os_server_action'", version=2.8)

if not HAS_SHADE:
module.fail_json(msg='shade is required for this module')

Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_affinity_groups.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_affinity_labels.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_clusters.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_clusters_facts.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_datacenters.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_disks.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_groups.py
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/ovirt/_ovirt_groups_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

DOCUMENTATION = '''
---
module: ovirt_affinity_groups
module: ovirt_affinity_group
short_description: Module to manage affinity groups in oVirt/RHV
version_added: "2.3"
author: "Ondra Machacek (@machacekondra)"
Expand Down Expand Up @@ -88,7 +88,7 @@
# look at ovirt_auth module to see how to reuse authentication:
# Create(if not exists) and assign affinity group to VMs vm1 and vm2 and host host1
- ovirt_affinity_groups:
- ovirt_affinity_group:
name: mygroup
cluster: mycluster
vm_enforcing: true
Expand All @@ -102,7 +102,7 @@
- host1
# Detach VMs from affinity group and disable VM rule:
- ovirt_affinity_groups:
- ovirt_affinity_group:
name: mygroup
cluster: mycluster
vm_enforcing: false
Expand All @@ -115,7 +115,7 @@
- host2
# Remove affinity group
- ovirt_affinity_groups:
- ovirt_affinity_group:
state: absent
cluster: mycluster
name: mygroup
Expand Down Expand Up @@ -293,6 +293,10 @@ def main():
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'ovirt_affinity_groups':
module.deprecate("The 'ovirt_affinity_groups' module is being renamed 'ovirt_affinity_group'", version=2.8)

check_sdk(module)
try:
auth = module.params.pop('auth')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

DOCUMENTATION = '''
---
module: ovirt_affinity_labels
module: ovirt_affinity_label
short_description: Module to manage affinity labels in oVirt/RHV
version_added: "2.3"
author: "Ondra Machacek (@machacekondra)"
Expand Down Expand Up @@ -60,7 +60,7 @@
# look at ovirt_auth module to see how to reuse authentication:
# Create(if not exists) and assign affinity label to vms vm1 and vm2 and host host1
- ovirt_affinity_labels:
- ovirt_affinity_label:
name: mylabel
cluster: mycluster
vms:
Expand All @@ -70,13 +70,13 @@
- host1
# To detach all VMs from label
- ovirt_affinity_labels:
- ovirt_affinity_label:
name: mylabel
cluster: mycluster
vms: []
# Remove affinity label
- ovirt_affinity_labels:
- ovirt_affinity_label:
state: absent
name: mylabel
'''
Expand Down Expand Up @@ -180,6 +180,10 @@ def main():
('state', 'present', ['cluster']),
],
)

if module._name == 'ovirt_affinity_labels':
module.deprecate("The 'ovirt_affinity_labels' module is being renamed 'ovirt_affinity_label'", version=2.8)

check_sdk(module)

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

DOCUMENTATION = '''
---
module: ovirt_affinity_labels_facts
module: ovirt_affinity_label_facts
short_description: Retrieve facts about one or more oVirt/RHV affinity labels
author: "Ondra Machacek (@machacekondra)"
version_added: "2.3"
Expand All @@ -53,28 +53,28 @@
# look at ovirt_auth module to see how to reuse authentication:
# Gather facts about all affinity labels, which names start with C(label):
- ovirt_affinity_labels_facts:
- ovirt_affinity_label_facts:
name: label*
- debug:
var: affinity_labels
# Gather facts about all affinity labels, which are assigned to VMs
# which names start with C(postgres):
- ovirt_affinity_labels_facts:
- ovirt_affinity_label_facts:
vm: postgres*
- debug:
var: affinity_labels
# Gather facts about all affinity labels, which are assigned to hosts
# which names start with C(west):
- ovirt_affinity_labels_facts:
- ovirt_affinity_label_facts:
host: west*
- debug:
var: affinity_labels
# Gather facts about all affinity labels, which are assigned to hosts
# which names start with C(west) or VMs which names start with C(postgres):
- ovirt_affinity_labels_facts:
- ovirt_affinity_label_facts:
host: west*
vm: postgres*
- debug:
Expand Down Expand Up @@ -108,6 +108,10 @@ def main():
vm=dict(default=None),
)
module = AnsibleModule(argument_spec)

if module._name == 'ovirt_affinity_labels_facts':
module.deprecate("The 'ovirt_affinity_labels_facts' module is being renamed 'ovirt_affinity_label_facts'", version=2.8)

check_sdk(module)

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

DOCUMENTATION = '''
---
module: ovirt_clusters
module: ovirt_cluster
short_description: Module to manage clusters in oVirt/RHV
version_added: "2.3"
author: "Ondra Machacek (@machacekondra)"
Expand Down Expand Up @@ -216,15 +216,15 @@
# look at ovirt_auth module to see how to reuse authentication:
# Create cluster
- ovirt_clusters:
- ovirt_cluster:
data_center: mydatacenter
name: mycluster
cpu_type: Intel SandyBridge Family
description: mycluster
compatibility_version: 4.0
# Create virt service cluster:
- ovirt_clusters:
- ovirt_cluster:
data_center: mydatacenter
name: mycluster
cpu_type: Intel Nehalem Family
Expand All @@ -245,7 +245,7 @@
- random
# Remove cluster
- ovirt_clusters:
- ovirt_cluster:
state: absent
name: mycluster
'''
Expand Down Expand Up @@ -548,6 +548,10 @@ def main():
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'ovirt_clusters':
module.deprecate("The 'ovirt_clusters' module is being renamed 'ovirt_cluster'", version=2.8)

check_sdk(module)

try:
Expand Down
Loading

0 comments on commit 6806000

Please sign in to comment.