diff --git a/cloud/ec2_elb b/cloud/ec2_elb index c7a4e0d3b3f..4fc6910691b 100644 --- a/cloud/ec2_elb +++ b/cloud/ec2_elb @@ -313,12 +313,11 @@ class ElbManager: def main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( - state={'required': True, - 'choices': ['present', 'absent']}, + state={'required': True, 'type' : 'bool'}, instance_id={'required': True}, ec2_elbs={'default': None, 'required': False, 'type':'list'}, - enable_availability_zone={'default': True, 'required': False, 'choices': BOOLEANS, 'type': 'bool'}, - wait={'required': False, 'choices': BOOLEANS, 'default': True, 'type': 'bool'}, + enable_availability_zone={'default': True, 'required': False, 'type': 'bool'}, + wait={'required': False, 'default': True, 'type': 'bool'}, wait_timeout={'requred': False, 'default': 0, 'type': 'int'} ) ) diff --git a/cloud/ec2_elb_lb b/cloud/ec2_elb_lb index ca3adc31931..0737b1a087b 100644 --- a/cloud/ec2_elb_lb +++ b/cloud/ec2_elb_lb @@ -467,11 +467,9 @@ def main(): state={'required': True, 'choices': ['present', 'absent']}, name={'required': True}, listeners={'default': None, 'required': False, 'type': 'list'}, - purge_listeners={'default': True, 'required': False, - 'choices': BOOLEANS, 'type': 'bool'}, + purge_listeners={'default': True, 'required': False, 'type': 'bool'}, zones={'default': None, 'required': False, 'type': 'list'}, - purge_zones={'default': False, 'required': False, - 'choices': BOOLEANS, 'type': 'bool'}, + purge_zones={'default': False, 'required': False, 'type': 'bool'}, security_group_ids={'default': None, 'required': False, 'type': 'list'}, health_check={'default': None, 'required': False, 'type': 'dict'}, ) diff --git a/cloud/ec2_snapshot b/cloud/ec2_snapshot index 0b499e47765..8673525dfe0 100644 --- a/cloud/ec2_snapshot +++ b/cloud/ec2_snapshot @@ -124,7 +124,7 @@ def main(): ec2_url = dict(), ec2_secret_key = dict(aliases=['aws_secret_key', 'secret_key'], no_log=True), ec2_access_key = dict(aliases=['aws_access_key', 'access_key']), - wait = dict(choices=BOOLEANS, default='true'), + wait = dict(type='bool', default='true'), wait_timeout = dict(type='number', default=0), snapshot_tags = dict(type='dict', default=dict()), ) diff --git a/cloud/elasticache b/cloud/elasticache index c506b4719c8..54bf734d204 100644 --- a/cloud/elasticache +++ b/cloud/elasticache @@ -489,8 +489,8 @@ def main(): security_group_ids={'required': False, 'default': [], 'type': 'list'}, zone={'required': False, 'default': None}, - wait={'required': False, 'choices': BOOLEANS, 'default': True}, - hard_modify={'required': False, 'choices': BOOLEANS, 'default': False} + wait={'required': False, 'type' : 'bool', 'default': True}, + hard_modify={'required': False, 'type': 'bool', 'default': False} ) ) diff --git a/cloud/gce_pd b/cloud/gce_pd index a8e631a5522..04083aa89eb 100644 --- a/cloud/gce_pd +++ b/cloud/gce_pd @@ -127,10 +127,9 @@ except ImportError: def main(): module = AnsibleModule( argument_spec = dict( - detach_only = dict(choice=BOOLEANS), + detach_only = dict(type='bool'), instance_name = dict(), - mode = dict(default='READ_ONLY', - choices=['READ_WRITE', 'READ_ONLY']), + mode = dict(default='READ_ONLY', choices=['READ_WRITE', 'READ_ONLY']), name = dict(required=True), size_gb = dict(default=10), state = dict(default='present'), diff --git a/system/authorized_key b/system/authorized_key index 1a7c8b97b0e..ac81c39d896 100644 --- a/system/authorized_key +++ b/system/authorized_key @@ -165,7 +165,7 @@ def keyfile(module, user, write=False, path=None, manage_dir=True): uid = user_entry.pw_uid gid = user_entry.pw_gid - if manage_dir in BOOLEANS_TRUE: + if manage_dir: if not os.path.exists(sshdir): os.mkdir(sshdir, 0700) if module.selinux_enabled(): diff --git a/system/sysctl b/system/sysctl index ab1da5e0959..fd6960f2228 100644 --- a/system/sysctl +++ b/system/sysctl @@ -185,9 +185,9 @@ class SysctlModule(object): def _parse_value(self, value): if value is None: return '' - elif value.lower() in BOOLEANS_TRUE: + elif value.lower(): return '1' - elif value.lower() in BOOLEANS_FALSE: + elif not value.lower(): return '0' else: return value.strip() diff --git a/system/ufw b/system/ufw index 07f51d853bc..73dc9e8974b 100644 --- a/system/ufw +++ b/system/ufw @@ -165,7 +165,7 @@ def main(): default = dict(default=None, aliases=['policy'], choices=['allow', 'deny', 'reject']), logging = dict(default=None, choises=['on', 'off', 'low', 'medium', 'high', 'full']), direction = dict(default=None, choises=['in', 'incoming', 'out', 'outgoing']), - delete = dict(default=False, choices=BOOLEANS), + delete = dict(default=False, type='bool'), insert = dict(default=None), rule = dict(default=None, choices=['allow', 'deny', 'reject', 'limit']), interface = dict(default=None, aliases=['if']),