mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-27 14:03:03 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed5829d462 | ||
|
|
b025e7c356 | ||
|
|
782340833e | ||
|
|
73aab9e80c | ||
|
|
ae7e8260a3 | ||
|
|
c5d0d3ec82 |
@@ -5,6 +5,25 @@ Ansible OpenStack Collection Release Notes
|
||||
.. contents:: Topics
|
||||
|
||||
|
||||
v2.3.3
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfixes and minor changes
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Add test to only_ipv4 in inventory
|
||||
- add an option to use only IPv4 only for ansible_host and ansible_ssh_host
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- CI - Fix deprecated ANSIBLE_COLLECTIONS_PATHS variable
|
||||
|
||||
v2.3.2
|
||||
======
|
||||
|
||||
|
||||
@@ -586,3 +586,12 @@ releases:
|
||||
- Drop compat implementations for tests
|
||||
release_summary: Bugfixes and minor changes
|
||||
release_date: '2024-12-20'
|
||||
2.3.3:
|
||||
changes:
|
||||
bugfixes:
|
||||
- CI - Fix deprecated ANSIBLE_COLLECTIONS_PATHS variable
|
||||
minor_changes:
|
||||
- Add test to only_ipv4 in inventory
|
||||
- add an option to use only IPv4 only for ansible_host and ansible_ssh_host
|
||||
release_summary: Bugfixes and minor changes
|
||||
release_date: '2024-12-22'
|
||||
|
||||
@@ -303,6 +303,25 @@
|
||||
that:
|
||||
- inventory.all.children.RegionOne.hosts.keys() | sort == ['ansible_server1', 'ansible_server2'] | sort
|
||||
|
||||
- name: List servers with inventory plugin with IPv4 only
|
||||
ansible.builtin.command:
|
||||
cmd: ansible-inventory --list --yaml --extra-vars only_ipv4=true --inventory-file openstack.yaml
|
||||
chdir: "{{ tmp_dir.path }}"
|
||||
environment:
|
||||
ANSIBLE_INVENTORY_CACHE: "True"
|
||||
ANSIBLE_INVENTORY_CACHE_PLUGIN: "jsonfile"
|
||||
ANSIBLE_CACHE_PLUGIN_CONNECTION: "{{ tmp_dir.path }}/.cache/"
|
||||
register: inventory
|
||||
|
||||
- name: Read YAML output from inventory plugin again
|
||||
ansible.builtin.set_fact:
|
||||
inventory: "{{ inventory.stdout | from_yaml }}"
|
||||
|
||||
- name: Check YAML output from inventory plugin again
|
||||
assert:
|
||||
that:
|
||||
- inventory.all.children.RegionOne.hosts.keys() | sort == ['ansible_server1', 'ansible_server2'] | sort
|
||||
|
||||
- name: Delete server 2
|
||||
openstack.cloud.resource:
|
||||
service: compute
|
||||
|
||||
@@ -75,10 +75,10 @@ ansible-galaxy collection install --requirements-file ci/requirements.yml
|
||||
if [ -z "$PIP_INSTALL" ]; then
|
||||
tox -ebuild
|
||||
ansible-galaxy collection install "$(find build_artifact/ -maxdepth 1 -name 'openstack-cloud-*')" --force
|
||||
TEST_COLLECTIONS_PATHS=${HOME}/.ansible/collections:$ANSIBLE_COLLECTIONS_PATHS
|
||||
TEST_COLLECTIONS_PATHS=${HOME}/.ansible/collections:$ANSIBLE_COLLECTIONS_PATH
|
||||
else
|
||||
pip freeze | grep ansible-collections-openstack
|
||||
TEST_COLLECTIONS_PATHS=$VIRTUAL_ENV/share/ansible/collections:$ANSIBLE_COLLECTIONS_PATHS
|
||||
TEST_COLLECTIONS_PATHS=$VIRTUAL_ENV/share/ansible/collections:$ANSIBLE_COLLECTIONS_PATH
|
||||
fi
|
||||
|
||||
# We need to source the current tox environment so that Ansible will
|
||||
@@ -129,7 +129,7 @@ cd ci/
|
||||
# Run tests
|
||||
set -o pipefail
|
||||
# shellcheck disable=SC2086
|
||||
ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \
|
||||
ANSIBLE_COLLECTIONS_PATH=$TEST_COLLECTIONS_PATHS ansible-playbook \
|
||||
-vvv ./run-collection.yml \
|
||||
-e "sdk_version=${SDK_VER} cloud=${CLOUD} cloud_alt=${CLOUD_ALT} ${ANSIBLE_VARS}" \
|
||||
${tag_opt} 2>&1 | sudo tee /opt/stack/logs/test_output.log
|
||||
|
||||
@@ -32,4 +32,4 @@ build_ignore:
|
||||
- .vscode
|
||||
- ansible_collections_openstack.egg-info
|
||||
- changelogs
|
||||
version: 2.3.2
|
||||
version: 2.3.3
|
||||
|
||||
@@ -96,6 +96,12 @@ options:
|
||||
only.
|
||||
type: bool
|
||||
default: false
|
||||
only_ipv4:
|
||||
description:
|
||||
- Use only ipv4 addresses for ansible_host and ansible_ssh_host.
|
||||
- Using I(only_ipv4) helps when running Ansible in a ipv4 only setup.
|
||||
type: bool
|
||||
default: false
|
||||
show_all:
|
||||
description:
|
||||
- Whether all servers should be listed or not.
|
||||
@@ -384,10 +390,17 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
if address['OS-EXT-IPS:type'] == 'floating'),
|
||||
None)
|
||||
|
||||
fixed_ip = next(
|
||||
(address['addr'] for address in addresses
|
||||
if address['OS-EXT-IPS:type'] == 'fixed'),
|
||||
None)
|
||||
if self.get_option('only_ipv4'):
|
||||
fixed_ip = next(
|
||||
(address['addr'] for address in addresses
|
||||
if (address['OS-EXT-IPS:type'] == 'fixed' and address['version'] == 4)),
|
||||
None)
|
||||
|
||||
else:
|
||||
fixed_ip = next(
|
||||
(address['addr'] for address in addresses
|
||||
if address['OS-EXT-IPS:type'] == 'fixed'),
|
||||
None)
|
||||
|
||||
ip = floating_ip if floating_ip is not None and not self.get_option('private') else fixed_ip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user