1 Commits
1.8.0 ... 1.7.1

Author SHA1 Message Date
Jakob Meng
b640e6207c Release 1.7.1 version
Change-Id: I958ba6890a54c59e0ccdb9249d959c745acfb8e9
2022-03-09 20:17:52 +01:00
43 changed files with 196 additions and 1097 deletions

View File

@@ -1,25 +1,16 @@
# yamllint disable
---
# Keep this file in sync between branches to avoid issues e.g. with job scheduling. Zuul CI will search in master branch
# first when collecting job variants during job freeze which can have unwanted side effects. For example, when parent
# job *-base has been changed in stable/1.0.0 branch, Zuul could still use *-base variants from master branch during job
# freeze on child jobs such as *-ussuri-ansible-2.11 etc.
- job:
name: ansible-collections-openstack-functional-devstack-base
name: ansible-collections-openstack-functional-devstack
parent: openstacksdk-functional-devstack
# Do not restrict branches in base jobs because else Zuul would not find a matching
# parent job variant during job freeze when child jobs are on other branches.
branches: ^(stable/1.0.0|master).*$
post-run: ci/playbooks/postlog.yaml
description: |
Run openstack collections functional tests against a devstack
# Do not set job.override-checkout or job.required-projects.override-checkout in base job because
# else Zuul will use this branch when matching variants for parent jobs during job freeze
Run openstack collections functional tests against a master devstack
using master of openstacksdk with latest ansible release
required-projects:
- openstack/ansible-collections-openstack
- openstack/designate
# openstack/devstack is required through parent job openstacksdk-functional-devstack
# openstack/os-client-config is required through parent job openstacksdk-functional-devstack
# openstack/openstacksdk is required through parent job openstacksdk-functional-devstack
irrelevant-files: &ignore_files
- changelogs/.*
- galaxy.*
@@ -34,7 +25,7 @@
vars:
zuul_work_dir: src/opendev.org/openstack/ansible-collections-openstack
tox_envlist: ansible
tox_install_siblings: true
tox_install_siblings: false
fetch_subunit: false
devstack_plugins:
designate: https://opendev.org/openstack/designate
@@ -47,25 +38,19 @@
log: true
- job:
name: ansible-collections-openstack-functional-devstack
parent: ansible-collections-openstack-functional-devstack-base
branches: master
name: ansible-collections-openstack-functional-devstack-octavia
parent: ansible-collections-openstack-functional-devstack
branches: ^(stable/1.0.0|master).*$
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk with latest ansible release
- job:
name: ansible-collections-openstack-functional-devstack-octavia-base
parent: ansible-collections-openstack-functional-devstack-base
# Do not restrict branches in base jobs because else Zuul would not find a matching
# parent job variant during job freeze when child jobs are on other branches.
description: |
Run openstack collections functional tests against a devstack with Octavia plugin enabled
with Octavia plugin enabled, using releases of openstacksdk and latest
ansible release. Run it only on Load Balancer changes.
pre-run: ci/playbooks/get_amphora_tarball.yaml
# Do not set job.override-checkout or job.required-projects.override-checkout in base job because
# else Zuul will use this branch when matching variants for parent jobs during job freeze
required-projects:
- openstack/octavia
- name: github.com/ansible/ansible
override-checkout: stable-2.12
files:
- ^ci/roles/loadbalancer/.*$
- ^plugins/modules/lb_health_monitor.py
@@ -75,7 +60,7 @@
- ^plugins/modules/loadbalancer.py
vars:
configure_swap_size: 8192
tox_install_siblings: false
tox_envlist: ansible
devstack_plugins:
designate: https://opendev.org/openstack/designate
octavia: https://opendev.org/openstack/octavia
@@ -92,171 +77,61 @@
OCTAVIA_AMP_IMAGE_SIZE: 3
OCTAVIA_AMP_IMAGE_NAME: "test-only-amphora-x64-haproxy-ubuntu-bionic"
- job:
name: ansible-collections-openstack-functional-devstack-octavia
parent: ansible-collections-openstack-functional-devstack-octavia-base
branches: master
description: |
Run openstack collections functional tests against a master devstack
with Octavia plugin enabled, using latest releases of openstacksdk
and latest ansible release. Run it only on Load Balancer changes.
- job:
name: ansible-collections-openstack-functional-devstack-octavia
parent: ansible-collections-openstack-functional-devstack-octavia-base
branches: stable/1.0.0
description: |
Run openstack collections functional tests against a master devstack
with Octavia plugin enabled, using 0.*.* releases of openstacksdk
and latest ansible release. Run it only on Load Balancer changes.
required-projects:
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/devstack
override-checkout: master
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/openstacksdk
override-checkout: master
vars:
tox_constraints_file: '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/constraints-openstacksdk-0.x.x.txt'
- job:
name: ansible-collections-openstack-functional-devstack-releases
parent: ansible-collections-openstack-functional-devstack-base
branches: master
parent: ansible-collections-openstack-functional-devstack
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using latest releases of openstacksdk and latest ansible release
# OpenStack SDK 1.*.* has not been released to PyPI yet
voting: false
using releases of openstacksdk and latest ansible release
vars:
# Uncomment once OpenStack SDK 1.*.* has been released to PyPI
# tox_constraints_file: '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/constraints-openstacksdk-1.x.x.txt'
tox_install_siblings: false
- job:
name: ansible-collections-openstack-functional-devstack-releases
parent: ansible-collections-openstack-functional-devstack-base
branches: stable/1.0.0
description: |
Run openstack collections functional tests against a master devstack
using 0.*.* releases of openstacksdk and latest ansible release
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.9
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/devstack
override-checkout: master
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/openstacksdk
override-checkout: master
vars:
tox_constraints_file: '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/constraints-openstacksdk-0.x.x.txt'
tox_envlist: ansible
tox_install_siblings: false
# Job with Ansible 2.9 for checking backward compatibility
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.9
parent: ansible-collections-openstack-functional-devstack-base
branches: master
parent: ansible-collections-openstack-functional-devstack
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.9 branch of ansible
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.9
vars:
tox_envlist: ansible-2.9
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.9
parent: ansible-collections-openstack-functional-devstack-base
branches: stable/1.0.0
description: |
Run openstack collections functional tests against a master devstack
using 0.*.* releases of openstacksdk and stable 2.9 branch of ansible
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.9
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/devstack
override-checkout: master
- name: openstack/openstacksdk
# Yoga has the latest SDK release of the 0.*.* series atm
override-checkout: stable/yoga
vars:
tox_envlist: ansible-2.9
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.11
parent: ansible-collections-openstack-functional-devstack-base
branches: master
parent: ansible-collections-openstack-functional-devstack
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.12 branch of ansible
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.11
vars:
tox_envlist: ansible-2.11
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.11
parent: ansible-collections-openstack-functional-devstack-base
branches: stable/1.0.0
description: |
Run openstack collections functional tests against a master devstack
using 0.*.* releases of openstacksdk and stable 2.12 branch of ansible
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.11
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/devstack
override-checkout: master
- name: openstack/openstacksdk
# Yoga has the latest SDK release of the 0.*.* series atm
override-checkout: stable/yoga
vars:
tox_envlist: ansible-2.11
tox_envlist: ansible
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.12
parent: ansible-collections-openstack-functional-devstack-base
branches: master
parent: ansible-collections-openstack-functional-devstack
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.12 branch of ansible
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
vars:
tox_envlist: ansible-2.12
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.12
parent: ansible-collections-openstack-functional-devstack-base
branches: stable/1.0.0
description: |
Run openstack collections functional tests against a master devstack
using 0.*.* releases of openstacksdk and stable 2.12 branch of ansible
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
- # Choose parent devstack job from master branch instead of non-existing stable/1.0.0 branch
name: openstack/devstack
override-checkout: master
- name: openstack/openstacksdk
# Yoga has the latest SDK release of the 0.*.* series atm
override-checkout: stable/yoga
vars:
tox_envlist: ansible-2.12
tox_envlist: ansible
- job:
name: ansible-collections-openstack-functional-devstack-ansible-devel
parent: ansible-collections-openstack-functional-devstack-base
branches: master
parent: ansible-collections-openstack-functional-devstack
override-checkout: master
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and devel branch of ansible
@@ -264,222 +139,143 @@
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel
vars:
tox_envlist: ansible-2.12
# Stable branches tests
- job:
name: ansible-collections-openstack-functional-devstack-xena-ansible-2.12
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a xena devstack
using xena branch of openstacksdk and stable 2.12 branch of ansible
branches: stable/1.0.0
using xena brach of openstacksdk and stable 2.12 branch of ansible
voting: true
override-checkout: stable/xena
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/xena branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/xena branch
name: openstack/devstack
override-checkout: stable/xena
- name: openstack/openstacksdk
override-checkout: stable/xena
vars:
tox_envlist: ansible-2.12
tox_envlist: ansible
tox_install_siblings: true
- job:
name: ansible-collections-openstack-functional-devstack-wallaby-ansible-2.12
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a wallaby devstack
using wallaby branch of openstacksdk and stable 2.12 branch of ansible
branches: stable/1.0.0
using wallaby brach of openstacksdk and stable 2.12 branch of ansible
voting: true
override-checkout: stable/wallaby
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/wallaby branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/wallaby branch
name: openstack/devstack
override-checkout: stable/wallaby
- name: openstack/openstacksdk
override-checkout: stable/wallaby
vars:
tox_envlist: ansible-2.12
tox_envlist: ansible
tox_install_siblings: true
- job:
name: ansible-collections-openstack-functional-devstack-victoria-ansible-2.12
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a victoria devstack
using victoria branch of openstacksdk and stable 2.12 branch of ansible
branches: stable/1.0.0
using victoria brach of openstacksdk and stable 2.12 branch of ansible
voting: true
override-checkout: stable/victoria
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/victoria branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/victoria branch
name: openstack/devstack
override-checkout: stable/victoria
- name: openstack/openstacksdk
override-checkout: stable/victoria
vars:
tox_envlist: ansible-2.12
tox_envlist: ansible
tox_install_siblings: true
- job:
name: ansible-collections-openstack-functional-devstack-ussuri-ansible-2.11
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a ussuri devstack
using ussuri branch of openstacksdk and stable 2.11 branch of ansible
branches: stable/1.0.0
using ussuri brach of openstacksdk and stable 2.11 branch of ansible
voting: true
override-checkout: stable/ussuri
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.11
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/ussuri branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/ussuri branch
name: openstack/devstack
override-checkout: stable/ussuri
- name: openstack/openstacksdk
override-checkout: stable/ussuri
- name: openstack/os-client-config
override-checkout: stable/ussuri
vars:
tox_envlist: ansible-2.11
tox_envlist: ansible
tox_install_siblings: true
- job:
name: ansible-collections-openstack-functional-devstack-train-ansible-2.11
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a train devstack
using train branch of openstacksdk and stable 2.11 branch of ansible
branches: stable/1.0.0
using train brach of openstacksdk and stable 2.11 branch of ansible
voting: true
override-checkout: stable/train
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.11
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/train branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/train branch
name: openstack/devstack
override-checkout: stable/train
- name: openstack/openstacksdk
override-checkout: stable/train
- name: openstack/os-client-config
override-checkout: stable/train
vars:
tox_envlist: ansible-2.11
tox_envlist: ansible
tox_install_siblings: true
- job:
name: ansible-collections-openstack-functional-devstack-queens-ansible-2.11
# Do not inherit from any parent job which does not run for branch stable/1.0.0 because Zuul would dismiss this job
# when collecting parent job variants. For example, when job.branches is set to master in a parent job, then Zuul
# will not match that job when it collects job variants.
#
# Do not inherit from any parent job which sets job.required-projects.override-checkout on openstack/devstack
# because Zuul would use that git ref instead of stable branch defined below to checkout projects of parent devstack
# jobs when collecting variants for parent jobs.
parent: ansible-collections-openstack-functional-devstack-base
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a queens devstack
using train branch of openstacksdk and stable 2.11 branch of ansible
branches: stable/1.0.0
using master branch of openstacksdk and stable 2.11 branch of ansible
voting: true
override-checkout: stable/queens
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.11
- # Choose parent devstack job from stable/1.0.0 branch instead of non-existing stable/queens branch
name: openstack/ansible-collections-openstack
override-checkout: stable/1.0.0
- # Choose parent devstack job from stable/queens branch
name: openstack/devstack
override-checkout: stable/queens
- name: openstack/openstacksdk
# Run queens with highest possible py2 version of SDK
override-checkout: stable/train
vars:
tox_envlist: ansible-2.11
tox_envlist: ansible
tox_install_siblings: true
# Linters
- job:
name: openstack-tox-linters-ansible
name: openstack-tox-linters-ansible-devel
parent: openstack-tox-linters
nodeset: ubuntu-focal
description: |
Run openstack collections linter tests using the devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel
vars:
# override tox_constraints_file from parent job
tox_constraints_file: '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/constraints-none.txt'
tox_envlist: linters
tox_install_siblings: true
- job:
name: openstack-tox-linters-ansible-devel
parent: openstack-tox-linters-ansible
description: |
Run openstack collections linter tests using the devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false
vars:
tox_envlist: linters-2.12
python_version: 3.8
bindep_profile: test py38
- job:
name: openstack-tox-linters-ansible-2.12
parent: openstack-tox-linters-ansible
parent: openstack-tox-linters
nodeset: ubuntu-focal
description: |
Run openstack collections linter tests using the 2.12 branch of ansible
voting: true
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.12
@@ -490,10 +286,11 @@
- job:
name: openstack-tox-linters-ansible-2.9
parent: openstack-tox-linters-ansible
parent: openstack-tox-linters
nodeset: ubuntu-bionic
description: |
Run openstack collections linter tests using the 2.9 branch of ansible
voting: true
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.9
@@ -506,17 +303,12 @@
parent: bifrost-integration-tinyipa-ubuntu-focal
required-projects:
- openstack/ansible-collections-openstack
- # always use master branch when collecting parent job variants, refer to git blame for rationale.
name: openstack/bifrost
override-checkout: master
- job:
name: bifrost-keystone-collections-src
parent: bifrost-integration-tinyipa-keystone-ubuntu-focal
required-projects:
- openstack/ansible-collections-openstack
- # always use master branch when collecting parent job variants, refer to git blame for rationale.
name: openstack/bifrost
override-checkout: master
# TripleO jobs
- job:
@@ -526,11 +318,6 @@
featureset: '052'
consumer_job: false
build_container_images: true
required-projects:
- openstack/ansible-collections-openstack
- # always use master branch when collecting parent job variants, refer to git blame for rationale.
name: openstack/tripleo-ci
override-checkout: master
irrelevant-files: &irr_files
- .*molecule.*
- ^.*\.md$
@@ -542,6 +329,7 @@
- ^tests/.*$
- ^tools/.*$
- ^requirements.*$
- ^test-requirements.*$
- ^setup.*$
- tox.ini
# Run only on files used in TripleO
@@ -575,7 +363,6 @@
- job:
name: tripleo-ci-centos-8-standalone-train-osa
parent: tripleo-ci-centos-8-standalone-osa
branches: stable/1.0.0
override-checkout: stable/train
vars:
branch_override: stable/train
@@ -583,7 +370,6 @@
- job:
name: tripleo-ci-centos-8-standalone-wallaby-osa
parent: tripleo-ci-centos-8-standalone-osa
branches: stable/1.0.0
override-checkout: stable/wallaby
vars:
branch_override: stable/wallaby
@@ -591,7 +377,7 @@
- job:
name: tripleo-ci-centos-9-standalone-wallaby-osa
parent: tripleo-ci-centos-9-standalone-osa
branches: stable/1.0.0
branches: ^(stable/1.0.0|master).*$
override-checkout: stable/wallaby
vars:
branch_override: stable/wallaby
@@ -631,7 +417,6 @@
- tox-pep8
- openstack-tox-linters-ansible-2.9
- openstack-tox-linters-ansible-2.12
voting: false
- ansible-collections-openstack-functional-devstack-releases:
dependencies: *deps_unit_lint
@@ -647,6 +432,7 @@
dependencies: *deps_unit_lint
- ansible-collections-openstack-functional-devstack-train-ansible-2.11:
dependencies: *deps_unit_lint
voting: false
- ansible-collections-openstack-functional-devstack-octavia:
dependencies: *deps_unit_lint
@@ -679,13 +465,13 @@
- tox-pep8
- openstack-tox-linters-ansible-2.12
- openstack-tox-linters-ansible-2.9
# - ansible-collections-openstack-functional-devstack
- ansible-collections-openstack-functional-devstack
- ansible-collections-openstack-functional-devstack-releases
# - ansible-collections-openstack-functional-devstack-ansible-2.9
# - ansible-collections-openstack-functional-devstack-ansible-2.12
- ansible-collections-openstack-functional-devstack-ansible-2.9
- ansible-collections-openstack-functional-devstack-ansible-2.12
- ansible-collections-openstack-functional-devstack-wallaby-ansible-2.12
- ansible-collections-openstack-functional-devstack-xena-ansible-2.12
- ansible-collections-openstack-functional-devstack-train-ansible-2.11
# - ansible-collections-openstack-functional-devstack-train-ansible-2.11
- ansible-collections-openstack-functional-devstack-octavia
- tripleo-ci-centos-8-standalone-wallaby-osa

View File

@@ -5,48 +5,6 @@ Openstack Cloud Ansilbe modules Release Notes
.. contents:: Topics
v1.8.0
======
Release Summary
---------------
Subnet pool module and bugfixes
Bugfixes
--------
- Add 'all_projects' to server_action module
- Add subnet pool module
- Bumped minimum required OpenStack SDK release to SDK 0.36.0 (Train)
- Changed compute_flavor_info module to use OpenStack SDK's proxy layer
- Dropped deprecated return values in floating_ip_info and assert remaining fields
- Fix ansible-lint issues for the newest version
- Fix assertion after stack deletion
- Handle aggregate host list set to None
- Reenabled check-import.sh which tests imports to Ansible Galaxy
- Remove old, unsupported parameters from documentation in image_info module
- Router - Remove unneeded 'filter' parameter
- Updated return value docs of compute_service_info module
New Modules
-----------
- openstack.cloud.subnet_pool - Create or Delete subnet pools from OpenStack.
v1.7.2
======
Release Summary
---------------
Bugfixes
Bugfixes
--------
- Fix collection guidelines
v1.7.1
======

View File

@@ -15,7 +15,7 @@ For using the Openstack Cloud collection firstly you need to install `ansible` a
For example with pip:
```bash
pip install "ansible>=2.9" "openstacksdk>=0.36"
pip install ansible openstacksdk
```
OpenStackSDK has to be available to Ansible and to the Python interpreter on the host, where Ansible executes the module (target host).

View File

@@ -313,31 +313,3 @@ releases:
- lb_member - Add monitor_[address,port] parameter
release_summary: Bugfixes
release_date: '2022-03-08'
1.7.2:
changes:
bugfixes:
- Fix collection guidelines
release_summary: Bugfixes
release_date: '2022-03-10'
1.8.0:
changes:
bugfixes:
- Add 'all_projects' to server_action module
- Add subnet pool module
- Bumped minimum required OpenStack SDK release to SDK 0.36.0 (Train)
- Changed compute_flavor_info module to use OpenStack SDK's proxy layer
- Dropped deprecated return values in floating_ip_info and assert remaining
fields
- Fix ansible-lint issues for the newest version
- Fix assertion after stack deletion
- Handle aggregate host list set to None
- Reenabled check-import.sh which tests imports to Ansible Galaxy
- Remove old, unsupported parameters from documentation in image_info module
- Router - Remove unneeded 'filter' parameter
- Updated return value docs of compute_service_info module
release_summary: Subnet pool module and bugfixes
modules:
- description: Create or Delete subnet pools from OpenStack.
name: subnet_pool
namespace: ''
release_date: '2022-04-08'

View File

@@ -1,33 +0,0 @@
---
- name: List flavors
openstack.cloud.compute_flavor_info:
cloud: "{{ cloud }}"
- name: List flavors with filter
openstack.cloud.compute_flavor_info:
cloud: "{{ cloud }}"
name: "m1.tiny"
register: flavor_name
- name: Check output of list flavors with filter
assert:
that:
- flavor_name.openstack_flavors | length == 1
- name: Assert fields on SDK 0.*
when: sdk_version is version(1.0, '<')
assert:
that:
- '["name", "description", "disk", "is_public", "ram",
"vcpus", "swap", "ephemeral", "is_disabled", "rxtx_factor", "id",
"extra_specs"] | difference(flavor_name.openstack_flavors.0.keys())
| length == 0'
- name: Assert fields on SDK 1.*
when: sdk_version is version(1.0, '>=')
assert:
that:
- '["name", "original_name", "description", "disk", "is_public", "ram",
"vcpus", "swap", "ephemeral", "is_disabled", "rxtx_factor", "id",
"extra_specs"] | difference(flavor_name.openstack_flavors.0.keys())
| length == 0'

View File

@@ -9,13 +9,3 @@
that:
- fips is success
- fips is not changed
- name: assert fields
when: fips.floating_ips|length > 0
assert:
that:
# allow new fields to be introduced but prevent fields from being removed
- '["created_at", "description", "dns_domain", "dns_name", "fixed_ip_address", "floating_ip_address",
"floating_network_id", "id", "name", "port_details", "port_id", "project_id", "qos_policy_id",
"revision_number", "router_id", "status", "subnet_id", "tags", "updated_at"]|
difference(fips.floating_ips.0.keys())|length == 0'

View File

@@ -7,13 +7,6 @@
register: result
failed_when: "result.openstack_compute_services | length <= 0"
- name: Assert fields
assert:
that:
- '["availability_zone", "binary", "disabled_reason", "is_forced_down",
"host", "name", "state", "status", "updated_at", "id"] |
difference(result.openstack_compute_services.0.keys()) | length == 0'
- name: Get nova conductor services info
openstack.cloud.compute_service_info:
cloud: "{{ cloud }}"

View File

@@ -41,4 +41,4 @@
- assert:
that:
- stacks is defined
- (stacks['stacks']|length == 0) or (stacks['stacks'][0]['status'] == 'DELETE_COMPLETE')
- stacks['stacks']|length == 0

View File

@@ -1,8 +1,5 @@
server_network: private
server_name: ansible_server
server_alt_network: private_alt
server_alt_subnet: subnet_alt
server_alt_name: ansible_server_alt
flavor: m1.tiny
floating_ip_pool_name: public
boot_volume_size: 5

View File

@@ -518,95 +518,3 @@
that:
- info24.openstack_servers.0.status == 'ACTIVE'
- server is not changed
- name: Create network for alternate server
openstack.cloud.network:
cloud: "{{ cloud_alt }}"
name: "{{ server_alt_network }}"
state: present
- name: Create subnet for alternate server
openstack.cloud.subnet:
cloud: "{{ cloud_alt }}"
network_name: "{{ server_alt_network }}"
name: "{{ server_alt_subnet }}"
state: present
cidr: 192.168.0.0/24
- name: Create server in alternate project
openstack.cloud.server:
cloud: "{{ cloud_alt }}"
state: present
name: "{{ server_alt_name }}"
image: "{{ image }}"
flavor: "{{ flavor }}"
network: "{{ server_alt_network }}"
auto_floating_ip: false
wait: true
register: server_alt
- name: Get info about server in alternate project
openstack.cloud.server_info:
cloud: "{{ cloud_alt }}"
server: "{{ server_alt_name }}"
register: info25
- name: Ensure status for server in alternate project is ACTIVE
assert:
that:
- info25.openstack_servers.0.status == 'ACTIVE'
- name: Try to stop server in alternate project
openstack.cloud.server_action:
cloud: "{{ cloud }}"
server: "{{ server_alt_name }}"
action: stop
wait: true
ignore_errors: true
register: server_alt
- name: Ensure server was not stopped
assert:
that:
- server_alt is failed
- server_alt.msg == "Could not find server {{ server_alt_name }}"
- name: Stop server in alternate project with all_projects=true
openstack.cloud.server_action:
cloud: "{{ cloud }}"
server: "{{ server_alt_name }}"
action: stop
wait: true
all_projects: True
register: server_alt
- name: Get info about server in alternate project
openstack.cloud.server_info:
cloud: "{{ cloud_alt }}"
server: "{{ server_alt_name }}"
register: info26
- name: Ensure status for server is SHUTOFF
assert:
that:
- info26.openstack_servers.0.status == 'SHUTOFF'
- server_alt is changed
- name: Delete server in alternate project
openstack.cloud.server:
cloud: "{{ cloud_alt }}"
state: absent
name: "{{ server_alt_name }}"
wait: true
- name: Delete subnet for alternate server
openstack.cloud.subnet:
cloud: "{{ cloud_alt }}"
name: "{{ server_alt_subnet }}"
state: absent
- name: Delete network for alternate server
openstack.cloud.network:
cloud: "{{ cloud_alt }}"
name: "{{ server_alt_network }}"
state: absent

View File

@@ -1,5 +0,0 @@
subnet_pool_name: "subnet_pool"
address_scope_name: "address_scope"
default_prefix_length: 24
minimum_prefix_length: 10
maximum_prefix_length: 30

View File

@@ -1,73 +0,0 @@
---
- name: Create address_scope
openstack.cloud.address_scope:
cloud: "{{ cloud }}"
name: "{{ address_scope_name }}"
shared: False
ip_version: "4"
register: create_address_scope
- name: Create subnet pool
openstack.cloud.subnet_pool:
cloud: "{{ cloud }}"
name: "{{ subnet_pool_name }}"
shared: False
address_scope: "{{ address_scope_name }}"
prefixes:
- 192.168.0.0/24
register: create_subnet_pool
- name: Verify subnet pool
assert:
that:
- create_subnet_pool is successful
- create_subnet_pool is changed
- create_subnet_pool.subnet_pool.name == subnet_pool_name
- create_subnet_pool.subnet_pool.is_shared == False
- create_subnet_pool.subnet_pool.is_default == False
- create_subnet_pool.subnet_pool.address_scope_id == create_address_scope.address_scope.id
- create_subnet_pool.subnet_pool.prefixes == ['192.168.0.0/24']
- name: Update subnet pool
openstack.cloud.subnet_pool:
cloud: "{{ cloud }}"
name: "{{ subnet_pool_name }}"
address_scope: "{{ address_scope_name }}"
shared: False
default_prefix_length: "{{ default_prefix_length }}"
minimum_prefix_length: "{{ minimum_prefix_length }}"
maximum_prefix_length: "{{ maximum_prefix_length }}"
description: "test"
prefixes:
- 192.168.0.0/24
- 192.168.1.0/24
register: update_subnet_pool
- name: Verify updated subnet pool
assert:
that:
- update_subnet_pool is successful
- update_subnet_pool is changed
- update_subnet_pool.subnet_pool.name == subnet_pool_name
- update_subnet_pool.subnet_pool.is_shared == False
- update_subnet_pool.subnet_pool.is_default == False
- update_subnet_pool.subnet_pool.address_scope_id == create_address_scope.address_scope.id
- update_subnet_pool.subnet_pool.prefixes == ['192.168.0.0/23']
- update_subnet_pool.subnet_pool.description == 'test'
- update_subnet_pool.subnet_pool.default_prefix_length == default_prefix_length
- update_subnet_pool.subnet_pool.minimum_prefix_length == minimum_prefix_length
- update_subnet_pool.subnet_pool.maximum_prefix_length == maximum_prefix_length
- name: Delete created subnet pool
openstack.cloud.subnet_pool:
cloud: "{{ cloud }}"
name: "{{ subnet_pool_name }}"
state: absent
- name: Delete created address scope
openstack.cloud.address_scope:
cloud: "{{ cloud }}"
name: "{{ address_scope_name }}"
state: absent

View File

@@ -6,22 +6,20 @@
#
# tox -e ansible [TAG ...]
# or
# tox -e ansible -- -c cloudX -u cloudY [TAG ...]
# tox -e ansible -- -c cloudX [TAG ...]
# or to use the development version of Ansible:
# tox -e ansible -- -d -c cloudX -u cloudY [TAG ...]
# tox -e ansible -- -d -c cloudX [TAG ...]
#
# USAGE:
# run-ansible-tests.sh -e ENVDIR [-d] [-c CLOUD] [-u CLOUD_ALT] [TAG ...]
# run-ansible-tests.sh -e ENVDIR [-d] [-c CLOUD] [TAG ...]
#
# PARAMETERS:
# -d Use Ansible source repo development branch.
# -e ENVDIR Directory of the tox environment to use for testing.
# -c CLOUD Name of the cloud to use for testing.
# Defaults to "devstack-admin".
# -u CLOUD_ALT Name of another cloud to use for testing.
# Defaults to "devstack-alt".
# [TAG ...] Optional list of space-separated tags to control which
# modules are tested.
# -d Use Ansible source repo development branch.
# -e ENVDIR Directory of the tox environment to use for testing.
# -c CLOUD Name of the cloud to use for testing.
# Defaults to "devstack-admin".
# [TAG ...] Optional list of space-separated tags to control which
# modules are tested.
#
# EXAMPLES:
# # Run all Ansible tests
@@ -33,16 +31,14 @@
set -ex
CLOUD="devstack-admin"
CLOUD_ALT="devstack-alt"
ENVDIR=
USE_DEV=0
while getopts "c:de:u:" opt
while getopts "c:de:" opt
do
case $opt in
d) USE_DEV=1 ;;
c) CLOUD=${OPTARG} ;;
u) CLOUD_ALT=${OPTARG} ;;
e) ENVDIR=${OPTARG} ;;
?) echo "Invalid option: -${OPTARG}"
exit 1;;
@@ -138,6 +134,6 @@ pushd ci/
set -o pipefail
ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \
-vvv ./run-collection.yml \
-e "sdk_version=${SDK_VER} cloud=${CLOUD} cloud_alt=${CLOUD_ALT} image=${IMAGE} ${ANSIBLE_VARS}" \
-e "sdk_version=${SDK_VER} cloud=${CLOUD} image=${IMAGE} ${ANSIBLE_VARS}" \
${tag_opt} 2>&1 | sudo tee /opt/stack/logs/test_output.log
popd

View File

@@ -35,8 +35,6 @@
- rbac
- neutron_rbac
- { role: nova_flavor, tags: nova_flavor }
- role: compute_flavor_info
tags: nova_flavor
- role: nova_services
tags: nova_services
when: sdk_version is version(0.44, '>=')
@@ -47,7 +45,6 @@
- { role: security_group, tags: security_group }
- { role: server, tags: server }
- { role: subnet, tags: subnet }
- { role: subnet_pool, tags: subnet_pool }
- { role: user, tags: user }
- { role: user_group, tags: user_group }
- { role: user_role, tags: user_role }

View File

@@ -13,7 +13,7 @@ Naming
------
* This is a collection named ``openstack.cloud``. There is no need for further namespace prefixing.
* Name any module that a cloud consumer would expect to use after the logical resource it manages:
* Name any module that a cloud consumer would expect to use after the logical resource it manages:
``server`` not ``nova``. This naming convention acknowledges that the end user does not care
which service manages the resource - that is a deployment detail. For example cloud consumers may
not know whether their floating IPs are managed by Nova or Neutron.
@@ -24,7 +24,6 @@ Interface
* If the resource being managed has an id, it should be returned.
* If the resource being managed has an associated object more complex than
an id, it should also be returned.
* Return format shall be a dictionary or list
Interoperability
----------------
@@ -54,7 +53,7 @@ Libraries
* All complex cloud interaction or interoperability code should be housed in
the `openstacksdk <https://opendev.org/openstack/openstacksdk>`_
library.
* All OpenStack API interactions should happen via the openstackSDK and not via
* All OpenStack API interactions should happen via the openstacksdk and not via
OpenStack Client libraries. The OpenStack Client libraries do no have end
users as a primary audience, they are for intra-server communication.
* All modules should be registered in ``meta/action_groups.yml`` for enabling the

View File

@@ -33,4 +33,4 @@ build_ignore:
- ansible_collections_openstack.egg-info
- contrib
- changelogs
version: 1.8.0
version: 1.7.1

View File

@@ -18,7 +18,7 @@ build_ignore:
- ci
- galaxy.yml.in
- setup.cfg
- test-requirements*
- test-requirements.txt
- tests
- tools
- tox.ini
@@ -29,7 +29,7 @@ build_ignore:
- importer_result.json
- .tox
- .env
- .vscode
- ansible_collections_openstack.egg-info
- contrib
- changelogs
- changelogs/.plugin-cache.yaml
- changelogs/fragments

View File

@@ -99,7 +99,6 @@ action_groups:
- stack
- subnet
- subnets_info
- subnet_pool
- volume
- volume_backup
- volume_backup_info

View File

@@ -25,7 +25,7 @@ options:
show_all:
description: toggles showing all vms vs only those with a working IP
type: bool
default: false
default: 'no'
inventory_hostname:
description: |
What to register as the inventory hostname.
@@ -47,7 +47,7 @@ options:
'ansible_ssh_host' facts. This might be desired when using jump or
bastion hosts and the name is the FQDN of the host.
type: bool
default: false
default: 'no'
expand_hostvars:
description: |
Run extra commands on each host to fill in additional
@@ -56,7 +56,7 @@ options:
(Note, the default value of this is opposite from the default
old openstack.py inventory script's option expand_hostvars)
type: bool
default: false
default: 'no'
private:
description: |
Use the private interface of each server, if it has one, as
@@ -64,13 +64,12 @@ options:
running ansible inside a server in the cloud and would rather
communicate to your servers over the private network.
type: bool
default: false
default: 'no'
only_clouds:
description: |
List of clouds from clouds.yaml to use, instead of using
the whole list.
type: list
elements: str
default: []
fail_on_errors:
description: |
@@ -81,12 +80,12 @@ options:
default value of this is opposite from the old openstack.py
inventory script's option fail_on_errors)
type: bool
default: false
default: 'no'
all_projects:
description: |
Lists servers from all projects
type: bool
default: false
default: 'no'
clouds_yaml_path:
description: |
Override path to clouds.yaml file. If this value is given it
@@ -95,7 +94,6 @@ options:
/etc/ansible/openstack.yml to the regular locations documented
at https://docs.openstack.org/os-client-config/latest/user/configuration.html#config-files
type: list
elements: str
env:
- name: OS_CLIENT_CONFIG_FILE
compose:

View File

@@ -30,7 +30,7 @@ options:
ip_version:
description:
- The IP version of the subnet 4 or 6
default: '4'
default: 4
type: str
choices: ['4', '6']
shared:

View File

@@ -126,29 +126,6 @@ openstack_flavors:
returned: success
type: str
sample: "tiny"
description:
description: Description of the flavor
returned: success
type: str
sample: "Small flavor"
is_disabled:
description: Wether the flavor is enabled or not
returned: success
type: bool
sample: False
rxtx_factor:
description: Factor to be multiplied by the rxtx_base property of
the network it is attached to in order to have a
different bandwidth cap.
returned: success
type: float
sample: 1.0
extra_specs:
description: Optional parameters to configure different flavors
options.
returned: success
type: dict
sample: "{'hw_rng:allowed': True}"
disk:
description: Size of local disk, in GB.
returned: success
@@ -219,22 +196,16 @@ class ComputeFlavorInfoModule(OpenStackModule):
filters['ephemeral'] = ephemeral
if name:
# extra_specs are exposed in the flavor representation since Rocky, so we do not
# need get_extra_specs=True which is not available in OpenStack SDK 0.36 (Train)
# Ref.: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html
flavor = self.conn.compute.find_flavor(name)
flavors = [flavor] if flavor else []
flavors = self.conn.search_flavors(filters={'name': name})
else:
flavors = list(self.conn.compute.flavors())
flavors = self.conn.list_flavors()
if filters:
flavors = self.conn.range_search(flavors, filters)
if limit is not None:
flavors = flavors[:limit]
# Transform entries to dict
flavors = [flavor.to_dict(computed=True) for flavor in flavors]
self.exit_json(changed=False, openstack_flavors=flavors)

View File

@@ -59,22 +59,10 @@ openstack_compute_services:
description: The name of the host.
returned: success
type: str
disabled_reason:
description: The reason why the service is disabled
returned: success
type: str
availability_zone:
zone:
description: The availability zone name.
returned: success
type: str
is_forced_down:
description: If the service has been forced down or nova-compute
returned: success
type: bool
name:
description: Service name
returned: success
type: str
status:
description: The status of the service. One of enabled or disabled.
returned: success
@@ -83,7 +71,7 @@ openstack_compute_services:
description: The state of the service. One of up or down.
returned: success
type: str
update_at:
update:
description: The date and time when the resource was updated
returned: success
type: str
@@ -110,7 +98,7 @@ class ComputeServiceInfoModule(OpenStackModule):
if host:
filters['host'] = host
services = self.conn.compute.services(**filters)
services = [service.to_dict(computed=True) for service in services]
services = list(services)
self.exit_json(changed=False, openstack_compute_services=services)

View File

@@ -165,6 +165,7 @@ class FloatingIPInfoModule(OpenStackModule):
router = self.params['router']
status = self.params['status']
data = []
query = {}
if description:
query['description'] = description
@@ -193,8 +194,15 @@ class FloatingIPInfoModule(OpenStackModule):
if status:
query['status'] = status.upper()
ips = [ip.to_dict(computed=False) for ip in self.conn.network.ips(**query)]
self.exit_json(changed=False, floating_ips=ips)
for raw in self.conn.network.ips(**query):
dt = raw.to_dict()
dt.pop('location')
data.append(dt)
self.exit_json(
changed=False,
floating_ips=data
)
def main():

View File

@@ -135,14 +135,14 @@ class ComputeHostAggregateModule(OpenStackModule):
if hosts is None:
return
hosts_to_add = set(hosts) - set(aggregate.get("hosts") or [])
hosts_to_add = set(hosts) - set(aggregate.get("hosts", []))
for i in hosts_to_add:
self.conn.add_host_to_aggregate(aggregate.id, i)
if not purge_hosts:
return
hosts_to_remove = set(aggregate.get("hosts") or []) - set(hosts)
hosts_to_remove = set(aggregate.get("hosts", [])) - set(hosts)
for i in hosts_to_remove:
self.conn.remove_host_from_aggregate(aggregate.id, i)

View File

@@ -61,7 +61,7 @@ options:
description:
- Prevent image from being deleted
type: bool
default: false
default: 'no'
filename:
description:
- The path to the file which has to be uploaded

View File

@@ -88,6 +88,10 @@ openstack_image:
description: Image created at timestamp.
returned: success
type: str
deleted:
description: Image deleted flag.
returned: success
type: bool
container_format:
description: Container format of the image.
returned: success
@@ -128,6 +132,10 @@ openstack_image:
description: Is public flag of the image.
returned: success
type: bool
deleted_at:
description: Image deleted at timestamp.
returned: success
type: str
size:
description: Size of the image.
returned: success

View File

@@ -45,7 +45,7 @@ options:
- The number of successful checks before changing the operating status of the member to ONLINE.
max_retries_down:
type: 'str'
default: '3'
default: 3
description:
- The number of allowed check failures before changing the operating status of the member to ERROR. A valid value is from 1 to 10. The default is 3.
resp_timeout:
@@ -60,7 +60,7 @@ options:
type: bool
expected_codes:
type: 'str'
default: '200'
default: 200
description:
- The list of HTTP status codes expected in response from the member to declare it healthy. Specify one of the following values
A single value, such as 200

View File

@@ -234,7 +234,8 @@ class RouterModule(OpenStackModule):
missing_port_ids,
requested_subnet_ids,
existing_subnet_ids,
router_ifs_cfg):
router_ifs_cfg,
filters=None):
"""Decide if the given router needs an update."""
if router['admin_state_up'] != self.params['admin_state_up']:
return True
@@ -475,7 +476,8 @@ class RouterModule(OpenStackModule):
missing_port_ids,
requested_subnet_ids,
existing_subnet_ids,
router_ifs_cfg)
router_ifs_cfg,
filters)
self.exit_json(changed=changed)
if state == 'present':
@@ -508,7 +510,8 @@ class RouterModule(OpenStackModule):
missing_port_ids,
requested_subnet_ids,
existing_subnet_ids,
router_ifs_cfg):
router_ifs_cfg,
filters):
changed = True
kwargs = self._build_kwargs(router, net)
updated_router = self.conn.update_router(**kwargs)

View File

@@ -49,7 +49,6 @@ options:
description:
- A list of tags to filter the list result by. Resources that match all tags in this list will be returned.
type: list
elements: str
requirements:
- "python >= 3.6"
- "openstacksdk"

View File

@@ -46,12 +46,6 @@ options:
description:
- Admin password for server to rebuild
type: str
all_projects:
description:
- Whether to search for server in all projects or just the current
auth scoped project.
type: bool
default: 'no'
requirements:
- "python >= 3.6"
@@ -126,7 +120,6 @@ class ServerActionModule(OpenStackModule):
'rebuild', 'shelve', 'shelve_offload', 'unshelve']),
image=dict(required=False, type='str'),
admin_password=dict(required=False, type='str', no_log=True),
all_projects=dict(required=False, type='bool', default=False),
)
module_kwargs = dict(
required_if=[('action', 'rebuild', ['image'])],
@@ -144,10 +137,7 @@ class ServerActionModule(OpenStackModule):
def _preliminary_checks(self):
# Using Munch object for getting information about a server
os_server = self.conn.get_server(
self.params['server'],
all_projects=self.params['all_projects'],
)
os_server = self.conn.get_server(self.params['server'])
if not os_server:
self.fail_json(msg='Could not find server %s' % self.params['server'])
# check mode
@@ -203,9 +193,8 @@ class ServerActionModule(OpenStackModule):
def _wait(self, os_server):
"""Wait for the server to reach the desired state for the given action."""
# The wait_for_server function needs a Server object instead of the
# Munch object returned by self.conn.get_server
server = self.conn.compute.get_server(os_server['id'])
# Using Server object for wait_for_server function
server = self.conn.compute.find_server(self.params['server'])
states = _action_map[self.params['action']]
try:

View File

@@ -39,7 +39,7 @@ options:
ip_version:
description:
- The IP version of the subnet 4 or 6
default: '4'
default: 4
type: str
choices: ['4', '6']
enable_dhcp:

View File

@@ -1,345 +0,0 @@
#!/usr/bin/python
# coding: utf-8 -*-
#
# Copyright (c) 2021 by Uemit Seren <uemit.seren@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
---
module: subnet_pool
short_description: Create or delete subnet pools from OpenStack
author: OpenStack Ansible SIG
description:
- Create or Delete subnet pools from OpenStack.
options:
state:
description:
- Indicate desired state of the resource
choices: ['present', 'absent']
default: present
type: str
name:
description:
- Name to be give to the subnet pool
required: true
type: str
project:
description:
- Unique name or ID of the project.
type: str
prefixes:
description:
- Set subnet pool prefixes (in CIDR notation)
type: list
elements: str
minimum_prefix_length:
description:
- The minimum prefix length that can be allocated from the subnet pool.
required: False
type: int
maximum_prefix_length:
description:
- The maximum prefix length that can be allocated from the subnet pool.
required: False
type: int
default_prefix_length:
description:
- The length of the prefix to allocate when the cidr or prefixlen attributes
are omitted when creating a subnet
type: int
required: False
address_scope:
description:
- Set address scope (ID or name) associated with the subnet pool
type: str
required: False
is_default:
description:
- Whether this subnet pool is by default
type: bool
default: 'no'
description:
description: The subnet pool description
type: str
required: False
default_quota:
description:
- A per-project quota on the prefix space that can be allocated
from the subnet pool for project subnets
required: False
type: int
shared:
description:
- Whether this subnet pool is shared or not.
type: bool
default: 'no'
extra_specs:
description:
- Dictionary with extra key/value pairs passed to the API
required: false
default: {}
type: dict
requirements:
- "python >= 3.6"
- "openstacksdk"
extends_documentation_fragment:
- openstack.cloud.openstack
'''
EXAMPLES = '''
# Create an subnet pool.
- openstack.cloud.subnet_pool:
cloud: mycloud
state: present
name: my_subnet_pool
prefixes:
- 10.10.10.0/24
# Create a subnet pool for a given project.
- openstack.cloud.subnet_pool:
cloud: mycloud
state: present
name: my_subnet_pool
project: myproj
prefixes:
- 10.10.10.0/24
# Create a shared and default subnet pool in existing address scope
- openstack.cloud.subnet_pool:
cloud: mycloud
state: present
name: my_subnet_pool
address_scope: my_adress_scope
is_default: True
default_quota: 10
maximum_prefix_length: 32
minimum_prefix_length: 8
default_prefix_length: 24
shared: True
prefixes:
- 10.10.10.0/8
# Delete subnet poool.
- openstack.cloud.subnet_pool:
cloud: mycloud
state: absent
name: my_subnet_pool
'''
RETURN = '''
subnet_pool:
description: Dictionary describing the subnet pool.
returned: On success when I(state) is 'present'
type: complex
contains:
id:
description: Subnet Pool ID.
type: str
sample: "474acfe5-be34-494c-b339-50f06aa143e4"
name:
description: Subnet Pool name.
type: str
sample: "my_subnet_pool"
project_id:
description: The ID of the project.
type: str
sample: "861174b82b43463c9edc5202aadc60ef"
ip_version:
description: The IP version of the subnet pool 4 or 6.
type: int
sample: 4
is_shared:
description: Indicates whether this subnet pool is shared across all projects.
type: bool
sample: false
is_default:
description: Indicates whether this is the default subnet pool.
type: bool
sample: false
address_scope_id:
description: The address scope ID.
type: str
sample: "861174b82b43463c9edc5202aadc60ef"
created_at:
description: Timestamp when the subnet pool was created.
type: str
sample: ""
default_prefix_length:
description:
- The length of the prefix to allocate when the cidr or prefixlen
attributes are omitted when creating a subnet
type: int
sample: 32
default_quota:
description:
- The per-project quota on the prefix space that can be allocated
from the subnet pool for project subnets.
type: int
sample: 22
description:
description: The subnet pool description.
type: str
sample: "My test subnet pool."
maximum_prefix_length:
description: The maximum prefix length that can be allocated from the subnet pool.
type: int
sample: 22
minimum_prefix_length:
description: The minimum prefix length that can be allocated from the subnet pool.
type: int
sample: 8
prefixes:
description: A list of subnet prefixes that are assigned to the subnet pool.
type: list
sample: ['10.10.20.0/24', '10.20.10.0/24']
revision_number:
description: Revision number of the subnet pool.
type: int
sample: 5
updated_at:
description: Timestamp when the subnet pool was last updated.
type: str
sample:
'''
from ansible_collections.openstack.cloud.plugins.module_utils.openstack import OpenStackModule
class SubnetPoolModule(OpenStackModule):
argument_spec = dict(
state=dict(default='present', choices=['absent', 'present']),
name=dict(required=True),
shared=dict(default=False, type='bool'),
minimum_prefix_length=dict(default=None, type='int'),
maximum_prefix_length=dict(default=None, type='int'),
default_prefix_length=dict(default=None, type='int'),
description=dict(default=None, type='str'),
default_quota=dict(default=None, type='int'),
prefixes=dict(type='list', elements='str'),
is_default=dict(default=False, type='bool'),
address_scope=dict(default=None),
project=dict(default=None),
extra_specs=dict(type='dict', default=dict())
)
def _needs_update(self, subnet_pool):
"""Check for differences in the updatable values.
NOTE: We don't currently allow name updates.
"""
compare_simple = ['is_default',
'minimum_prefix_length',
'maximum_prefix_length',
'default_prefix_length',
'description',
'default_quota']
compare_list = ['prefixes']
for key in compare_simple:
if self.params[key] is not None and self.params[key] != subnet_pool[key]:
return True
for key in compare_list:
if (
self.params[key] is not None
and set(self.params[key]) != set(subnet_pool[key])
):
return True
return False
def _system_state_change(self, subnet_pool, filters=None):
"""Check if the system state would be changed."""
state = self.params['state']
if state == 'absent' and subnet_pool:
return True
if state == 'present':
if not subnet_pool:
return True
return self._needs_update(subnet_pool, filters)
return False
def _compose_subnet_pool_args(self):
subnet_pool_kwargs = {}
optional_parameters = ['name',
'minimum_prefix_length',
'maximum_prefix_length',
'default_prefix_length',
'description',
'is_default',
'default_quota',
'prefixes']
for optional_param in optional_parameters:
if self.params[optional_param] is not None:
subnet_pool_kwargs[optional_param] = self.params[optional_param]
return subnet_pool_kwargs
def run(self):
state = self.params['state']
name = self.params['name']
project = self.params['project']
address_scope = self.params['address_scope']
extra_specs = self.params['extra_specs']
if project is not None:
proj = self.conn.get_project(project)
if proj is None:
self.fail(msg='Project %s could not be found' % project)
project_id = proj['id']
else:
project_id = self.conn.current_project_id
address_scope_id = None
if address_scope is not None:
address_scope = self.conn.network.find_address_scope(name_or_id=address_scope)
if address_scope is None:
self.fail(msg='AddressScope %s could not be found' % address_scope)
address_scope_id = address_scope['id']
subnet_pool = self.conn.network.find_subnet_pool(name_or_id=name)
if self.ansible.check_mode:
self.exit_json(
changed=self._system_state_change(subnet_pool)
)
if state == 'present':
changed = False
if not subnet_pool:
kwargs = self._compose_subnet_pool_args()
kwargs['address_scope_id'] = address_scope_id
kwargs['project_id'] = project_id
kwargs['is_shared'] = self.params['shared']
dup_args = set(kwargs.keys()) & set(extra_specs.keys())
if dup_args:
raise ValueError('Duplicate key(s) {0} in extra_specs'
.format(list(dup_args)))
kwargs = dict(kwargs, **extra_specs)
subnet_pool = self.conn.network.create_subnet_pool(**kwargs)
changed = True
else:
if self._needs_update(subnet_pool):
kwargs = self._compose_subnet_pool_args()
subnet_pool = self.conn.network.update_subnet_pool(subnet_pool['id'], **kwargs)
changed = True
else:
changed = False
self.exit_json(changed=changed, subnet_pool=subnet_pool, id=subnet_pool['id'])
elif state == 'absent':
if not subnet_pool:
self.exit(changed=False)
else:
self.conn.network.delete_subnet_pool(subnet_pool['id'])
self.exit_json(changed=True)
def main():
module = SubnetPoolModule()
module()
if __name__ == '__main__':
main()

View File

@@ -1 +1 @@
openstacksdk>=0.36
openstacksdk>=0.13

View File

@@ -1,11 +1,11 @@
ansible-core
flake8
galaxy-importer
openstacksdk
ansible-core
pycodestyle
flake8
pylint
rstcheck
ruamel.yaml
tox
voluptuous
yamllint
rstcheck
ruamel.yaml
#galaxy-importer # see https://review.opendev.org/#/c/743054
tox

View File

@@ -1,11 +1,11 @@
ansible-core>=2.11.0,<2.12.0
flake8
galaxy-importer
openstacksdk
ansible-core
pycodestyle
flake8
pylint
rstcheck
ruamel.yaml
tox
voluptuous
yamllint
rstcheck
ruamel.yaml
#galaxy-importer # see https://review.opendev.org/#/c/743054
tox

View File

@@ -1,11 +1,11 @@
ansible-core>=2.12.0,<2.13.0
flake8
galaxy-importer
openstacksdk
ansible<2.10
pycodestyle
flake8
pylint
rstcheck
ruamel.yaml
tox
voluptuous
yamllint
rstcheck
ruamel.yaml
#galaxy-importer # see https://review.opendev.org/#/c/743054
tox

1
test-requirements.txt Symbolic link
View File

@@ -0,0 +1 @@
test-requirements-2.11.txt

View File

@@ -1 +0,0 @@
# No constraints are defined by default

View File

@@ -1 +0,0 @@
openstacksdk<1.0.0

View File

@@ -1 +0,0 @@
openstacksdk>=1.0.0

View File

@@ -1,13 +0,0 @@
ansible>=2.9.0,<2.10.0
flake8
# galaxy-importer 0.3.2 moved from ansible 2.9 to ansible-core 2.11
# Ref.: https://github.com/ansible/galaxy-importer/commit/98933547831922c45243f39d85eefe150b55fc36
galaxy-importer==0.3.1
openstacksdk
pycodestyle
pylint
rstcheck
ruamel.yaml
tox
voluptuous
yamllint

View File

@@ -15,5 +15,11 @@
set -e
TOXDIR="${1:-.}"
python -m galaxy_importer.main "$TOXDIR/build_artifact/"*
TOXDIR=${1:-.}
######### Disbaled in https://review.opendev.org/#/c/743054
# galaxy_importer.main does not return non-zero error code on error
#output=$(python -m galaxy_importer.main $TOXDIR/build_artifact/*)
#if echo $output | grep ERROR: ; then
# exit 1
#fi

39
tox.ini
View File

@@ -1,6 +1,6 @@
[tox]
minversion = 3.18.0
envlist = linters
envlist = pep8
skipsdist = True
ignore_basepython_conflict = True
@@ -21,8 +21,7 @@ setenv =
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
pip: PIP_INSTALL={env:PIP_INSTALL:true}
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements.txt
-r{toxinidir}/test-requirements.txt
pip: {toxinidir}
commands = stestr run {posargs}
@@ -34,10 +33,9 @@ commands =
[testenv:build]
deps =
ansible-core
galaxy-importer
pbr
ruamel.yaml
ansible-core
commands =
python {toxinidir}/tools/build.py
@@ -59,22 +57,24 @@ commands =
passenv = {[testenv:linters]passenv}
commands = {[testenv:linters]commands}
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.9.txt
-r{toxinidir}/test-requirements-2.9.txt
[testenv:linters-2.11]
passenv = {[testenv:linters]passenv}
commands = {[testenv:linters]commands}
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.11.txt
-r{toxinidir}/test-requirements-2.11.txt
[testenv:linters-2.12]
passenv = {[testenv:linters]passenv}
commands = {[testenv:linters]commands}
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.12.txt
-r{toxinidir}/test-requirements-2.12.txt
[testenv:venv]
deps =
-r{toxinidir}/test-requirements.txt
commands = {posargs}
[flake8]
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
@@ -98,24 +98,29 @@ deps =
commands =
/bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs}
# PIP job runs with Ansible-2.9
[testenv:ansible-pip]
deps =
-r{toxinidir}/test-requirements-2.9.txt
{toxinidir}
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}
[testenv:ansible-2.9]
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.9.txt
-r{toxinidir}/test-requirements-2.9.txt
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}
[testenv:ansible-2.11]
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.11.txt
-r{toxinidir}/test-requirements-2.11.txt
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}
[testenv:ansible-2.12]
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
-r{toxinidir}/tests/requirements-ansible-2.12.txt
-r{toxinidir}/test-requirements-2.12.txt
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}