Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openstack add public IP options #263

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion doc/openstack/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ security_group.rules[].port_min Starting port (can't be used with port)
security_group.rules[].port_max Ending port (can't be used with port)
security_group.rules[].type IPv4 or IPv6, default 'IPv4'
user Default user of image
auto_ip Ensure instance has public IP, mutually \
exclusive with floating_ip_pools, \
default = true
floating_ip_pools List of floating pool IP names to choose a \
floating IP from, mutually exclusive with \
auto_ip, (optional)
volume Mapping of volume settings (optional if \
flavor provides volume)
volume.size Size of volume (GB)
Expand Down Expand Up @@ -96,6 +102,8 @@ Examples
flavor: m1.small
image: Debian_10
user: debian
floating_ip_pools: # mutually exclusive with auto_ip
- 1.2.3.4
network:
name: molecule
router:
Expand Down Expand Up @@ -139,9 +147,10 @@ Examples
network:
name: molecule # use network from debian10 instance
- name: ubuntu2004
falvor: m1.tiny
flavor: m1.tiny
image: Ubuntu_2004
user: ubuntu
auto_ip: false # do not assign a public IP
security_group:
name: molecule # use security group from debian10 instance
network:
Expand Down
2 changes: 2 additions & 0 deletions src/molecule_plugins/openstack/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Openstack(Driver):
flavor: m1.small
image: Ubuntu_20.04
user: ubuntu
floating_ip_pools: # mutually exclusive with auto_ip
- 1.2.3.4
security_group:
name: molecule-sec
description: Molecule test
Expand Down
2 changes: 2 additions & 0 deletions src/molecule_plugins/openstack/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
image: "{{ item.image }}"
key_name: "{{ key_name }}"
flavor: "{{ item.flavor }}"
floating_ip_pools: "{{ item.floating_ip_pools if item.floating_ip_pools is defined and item.floating_ip_pools | length > 0 else omit }}"
auto_ip: "{{ item.auto_ip if item.auto_ip is defined else omit }}"
boot_from_volume: "{{ true if item.volume is defined and item.volume.size else false }}"
terminate_volume: "{{ true if item.volume is defined and item.volume.size else false }}"
volume_size: "{{ item.volume.size if item.volume is defined and item.volume.size else omit }}"
Expand Down