--- - name: "Create {{ secgrp.name }} security group" os_security_group: state: present name: "{{ secgrp.name }}" - name: "Create {{ secgrp.name }} security group rule for ping" os_security_group_rule: security_group: "{{ secgrp.name }}" protocol: icmp remote_ip_prefix: "{{ item }}" loop: "{{ secgrp.remote_ip_prefix }}" - name: "Create {{ secgrp.name }} security group rule for all TCP" os_security_group_rule: security_group: "{{ secgrp.name }}" protocol: tcp remote_ip_prefix: "0.0.0.0/0" - name: "Create {{ secgrp.name }} security group rule for all UDP" os_security_group_rule: security_group: "{{ secgrp.name }}" protocol: udp