Security groups are the firewalls that can be used to allow or disallow the flow of traffic. They can be applied to virtual machines. Security groups and virtual machines have a many-to-many relationship. A single security group can be applied to multiple virtual machines and a single virtual machine can have multiple security groups.
Managing security groups
How to do it...
- Let's create a security group as follows:
- name: create a security group for web servers
os_security_group:
name: web-sg
state: present
description: security group for web servers
The name parameter has to be unique. The description parameter is optional, but we recommend using it to state the purpose of the security group. The preceding...