Managing network resources
A network is a basic building block of the infrastructure. Most of the cloud providers will supply a sample or default network. While setting up a self-hosted OpenStack instance, a single network is typically created automatically. However, if the network is not created, or if we want to create another network for the purpose of isolation or compliance, we can do so using the os_network
module.
How to do it…
- Let's go ahead and create an isolated network and name it private, as follows:
- name: creating a private network os_network: state: present name: private
- In the preceding example, we created a logical network with no subnets. A network with no subnets is of little use, so the next step would be to create a subnet:
- name: creating a private subnet os_subnet: state: present network_name: private name: app cidr: 192.168.0.0/24 dns_nameservers: - 8.8.4.4 - 8.8.8.8 host_routes: - destination: 0.0.0.0/0 nexthop...