diff --git a/plugins/inventory/ec2.py b/plugins/inventory/ec2.py index e93df1053d..76871b0266 100755 --- a/plugins/inventory/ec2.py +++ b/plugins/inventory/ec2.py @@ -787,7 +787,7 @@ class Ec2Inventory(object): ''' Converts 'bad' characters in a string to underscores so they can be used as Ansible groups ''' - return re.sub("[^A-Za-z0-9\-]", "_", word) + return re.sub("[^A-Za-z0-9\_]", "_", word) def json_format_dict(self, data, pretty=False):