February 2018
Intermediate to advanced
200 pages
5h 51m
English
- 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 task will create a security group for us, but there are no rules attached to it. A firewall without any rules is of little use. So let's go ahead and add a rule to allow access to port 80 as follows:
- name: allow port 80 for http os_security_group_rule: security_group: web-sg protocol: tcp port_range_min: 80 port_range_max: 80 remote_ip_prefix: 0.0.0.0/0
Read now
Unlock full access