tsuna-server / build-server-ansible

1 stars 0 forks source link

"openstack subnet create" command should change options between creating subnet for external or internal #44

Closed TsutomuNakamura closed 2 years ago

TsutomuNakamura commented 2 years ago

We should execute the command like below if we create a subnet that will be used as external(provider) subnet.

openstack subnet create \
    --network public \
    --allocation-pool start=192.168.1.101,end=192.168.1.250 \
    --no-dhcp \
    --subnet-range 192.168.1.0/24 \
    public_subnet

On the other hand, we should execute the command like below if we create a subnet that will be used as internal subnet.

openstack subnet create \
    --network private \
    --allocation-pool start=192.168.255.2,end=192.168.255.254 \
    --subnet-range 192.168.255.0/24 \
    --dns-nameserver 172.31.0.1 \
    --dns-nameserver 8.8.8.8 \
    --dns-nameserver 8.8.4.4 \
    private_subnet

--no-dhcp option is necessary for creating external subnet.

Current code below can not change during these situations. https://github.com/tsuna-server/build-server-ansible/blob/58c9cb66669c902650a6727bb4bf71f514224c0e/roles/test_env/tasks/create_example_subnet/do_create_subnet.yml#L55-L66

TsutomuNakamura commented 2 years ago

It was already fixed. close.