// Module included in the following assemblies:
//
// * installing/installing_openstack/installing-openstack-user.adoc

:_mod-docs-content-type: PROCEDURE
[id="installation-osp-creating-network-resources_{context}"]
= Creating network resources on {rh-openstack}

[role="_abstract"]
Create the network resources that an {product-title} on {rh-openstack-first} installation on your own infrastructure requires. To save time, run supplied Ansible playbooks that generate security groups, networks, subnets, routers, and ports.

.Prerequisites

* You downloaded the modules in "Downloading playbook dependencies".
* You downloaded the playbooks in "Downloading the installation playbooks".

.Procedure

. For a dual stack cluster deployment, edit the `inventory.yaml` file and uncomment the `os_subnet6` attribute.

. To ensure that your network resources have unique names on the {rh-openstack} deployment, create an environment variable and JSON file for use in the Ansible playbooks:
+
.. Create an environment variable that has a unique name value by running the following command:
+
[source,terminal]
----
$ export OS_NET_ID="openshift-$(dd if=/dev/urandom count=4 bs=1 2>/dev/null |hexdump -e '"%02x"')"
----

.. Verify that the variable is set by running the following command on a command line:
+
[source,terminal]
----
$ echo $OS_NET_ID
----

.. Create a JSON object that includes the variable in a file called `netid.json` by running the following command:
+
[source,terminal]
----
$ echo "{\"os_net_id\": \"$OS_NET_ID\"}" | tee netid.json
----

. On a command line, create the network resources by running the following command:
+
[source,terminal]
----
$ ansible-playbook -i inventory.yaml network.yaml
----
+
[NOTE]
====
The API and Ingress VIP fields will be overwritten in the `inventory.yaml` playbook with the IP addresses assigned to the network ports.
====
+
[NOTE]
====
The resources created by the `network.yaml` playbook are deleted by the `down-network.yaml` playbook.
====
