ansible/ansible-modules-core

os_security_group_rule is unable to add a rule in default security group

sdubrul opened this issue · 2 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME

os_security_group_rule

ANSIBLE VERSION
ansible 2.2.0.0
CONFIGURATION

N/A

OS / ENVIRONMENT

macOS 10.12.1

SUMMARY

When logged in as admin and trying to update the default security group rules for this tenant the command fails as there are multiple security groups that are called default. Security group default is found in the admin and services tenant.

STEPS TO REPRODUCE
# clouds.yml
clouds:
  mycloud:
    auth:
      auth_url: https://mycloud:5000/v2.0
      username: admin
      password: password
      project_name: admin


# task in playbook.yml
    - name: update default security group to allow ssh
      os_security_group_rule:
        cloud: mycloud
        security_group: default
        protocol: tcp
        direction: ingress
        remote_ip_prefix: 0.0.0.0/0
        port_range_min: 22
        port_range_max: 22

EXPECTED RESULTS

Expecting the command to update the admin tenant default security group as project name is defined in clouds.yml .

ACTUAL RESULTS

Task fails with:

fatal: [server]: FAILED! => {"changed": false, "failed": true, "msg": "Multiple matches found for default"}

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide.

This issue was moved to ansible/ansible#19124