mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-04-12 20:01:17 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bb8312171 | ||
|
|
b3ac841442 | ||
|
|
37c52c321d | ||
|
|
6edc70f965 | ||
|
|
cc8cd08c03 | ||
|
|
b572bf8ae9 | ||
|
|
b3e0d610ea | ||
|
|
291e8b8640 | ||
|
|
f70a50e363 | ||
|
|
befcc4353d | ||
|
|
8a91352a38 | ||
|
|
1d7fd25ac0 | ||
|
|
44fa06cba1 | ||
|
|
26bc8a0666 | ||
|
|
19d0562551 | ||
|
|
07c3ed0c17 | ||
|
|
8708167b5f | ||
|
|
a9565779b5 | ||
|
|
5c2069c47d | ||
|
|
583df2a8a9 | ||
|
|
0f532d10f3 | ||
|
|
87858ab976 | ||
|
|
09c3e4bdc9 | ||
|
|
ebffbe4fe8 | ||
|
|
cbcfce2e23 | ||
|
|
406558dae9 | ||
|
|
c8d89f81a5 | ||
|
|
c0e1f56894 | ||
|
|
a031968f80 | ||
|
|
2e78559cc1 | ||
|
|
bf939a4ce0 | ||
|
|
24d6f36602 | ||
|
|
dd9cdde3d8 |
380
.zuul.yaml
380
.zuul.yaml
@@ -1,16 +1,25 @@
|
|||||||
# yamllint disable
|
# 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:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack
|
name: ansible-collections-openstack-functional-devstack-base
|
||||||
parent: openstacksdk-functional-devstack
|
parent: openstacksdk-functional-devstack
|
||||||
branches: ^(stable/1.0.0|master).*$
|
# 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.
|
||||||
post-run: ci/playbooks/postlog.yaml
|
post-run: ci/playbooks/postlog.yaml
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a devstack
|
||||||
using master of openstacksdk with latest ansible release
|
# 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:
|
required-projects:
|
||||||
- openstack/ansible-collections-openstack
|
- openstack/ansible-collections-openstack
|
||||||
- openstack/designate
|
- 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
|
irrelevant-files: &ignore_files
|
||||||
- changelogs/.*
|
- changelogs/.*
|
||||||
- galaxy.*
|
- galaxy.*
|
||||||
@@ -25,7 +34,7 @@
|
|||||||
vars:
|
vars:
|
||||||
zuul_work_dir: src/opendev.org/openstack/ansible-collections-openstack
|
zuul_work_dir: src/opendev.org/openstack/ansible-collections-openstack
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible
|
||||||
tox_install_siblings: false
|
tox_install_siblings: true
|
||||||
fetch_subunit: false
|
fetch_subunit: false
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
designate: https://opendev.org/openstack/designate
|
designate: https://opendev.org/openstack/designate
|
||||||
@@ -38,19 +47,25 @@
|
|||||||
log: true
|
log: true
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-octavia
|
name: ansible-collections-openstack-functional-devstack
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-base
|
||||||
branches: ^(stable/1.0.0|master).*$
|
branches: master
|
||||||
override-checkout: master
|
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
with Octavia plugin enabled, using releases of openstacksdk and latest
|
using master of openstacksdk with latest ansible release
|
||||||
ansible release. Run it only on Load Balancer changes.
|
|
||||||
|
- 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
|
||||||
pre-run: ci/playbooks/get_amphora_tarball.yaml
|
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:
|
required-projects:
|
||||||
- openstack/octavia
|
- openstack/octavia
|
||||||
- name: github.com/ansible/ansible
|
|
||||||
override-checkout: stable-2.12
|
|
||||||
files:
|
files:
|
||||||
- ^ci/roles/loadbalancer/.*$
|
- ^ci/roles/loadbalancer/.*$
|
||||||
- ^plugins/modules/lb_health_monitor.py
|
- ^plugins/modules/lb_health_monitor.py
|
||||||
@@ -60,7 +75,7 @@
|
|||||||
- ^plugins/modules/loadbalancer.py
|
- ^plugins/modules/loadbalancer.py
|
||||||
vars:
|
vars:
|
||||||
configure_swap_size: 8192
|
configure_swap_size: 8192
|
||||||
tox_envlist: ansible
|
tox_install_siblings: false
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
designate: https://opendev.org/openstack/designate
|
designate: https://opendev.org/openstack/designate
|
||||||
octavia: https://opendev.org/openstack/octavia
|
octavia: https://opendev.org/openstack/octavia
|
||||||
@@ -78,60 +93,170 @@
|
|||||||
OCTAVIA_AMP_IMAGE_NAME: "test-only-amphora-x64-haproxy-ubuntu-bionic"
|
OCTAVIA_AMP_IMAGE_NAME: "test-only-amphora-x64-haproxy-ubuntu-bionic"
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-releases
|
name: ansible-collections-openstack-functional-devstack-octavia
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-octavia-base
|
||||||
override-checkout: master
|
branches: master
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
using releases of openstacksdk and latest ansible release
|
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:
|
vars:
|
||||||
tox_envlist: ansible
|
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
|
||||||
|
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
|
||||||
|
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_install_siblings: false
|
tox_install_siblings: false
|
||||||
|
|
||||||
# Job with Ansible 2.9 for checking backward compatibility
|
# Job with Ansible 2.9 for checking backward compatibility
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-ansible-2.9
|
name: ansible-collections-openstack-functional-devstack-ansible-2.9
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-base
|
||||||
override-checkout: master
|
branches: master
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
using master of openstacksdk and stable 2.9 branch of ansible
|
using master of openstacksdk and stable 2.9 branch of ansible
|
||||||
|
voting: false
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.9
|
override-checkout: stable-2.9
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible-2.9
|
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:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-ansible-2.11
|
name: ansible-collections-openstack-functional-devstack-ansible-2.11
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-base
|
||||||
override-checkout: master
|
branches: master
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
using master of openstacksdk and stable 2.12 branch of ansible
|
using master of openstacksdk and stable 2.12 branch of ansible
|
||||||
|
voting: false
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.11
|
override-checkout: stable-2.11
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
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
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-ansible-2.12
|
name: ansible-collections-openstack-functional-devstack-ansible-2.12
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-base
|
||||||
override-checkout: master
|
branches: master
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
using master of openstacksdk and stable 2.12 branch of ansible
|
using master of openstacksdk and stable 2.12 branch of ansible
|
||||||
|
voting: false
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.12
|
override-checkout: stable-2.12
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
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
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-ansible-devel
|
name: ansible-collections-openstack-functional-devstack-ansible-devel
|
||||||
parent: ansible-collections-openstack-functional-devstack
|
parent: ansible-collections-openstack-functional-devstack-base
|
||||||
override-checkout: master
|
branches: master
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a master devstack
|
Run openstack collections functional tests against a master devstack
|
||||||
using master of openstacksdk and devel branch of ansible
|
using master of openstacksdk and devel branch of ansible
|
||||||
@@ -139,143 +264,222 @@
|
|||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: devel
|
override-checkout: devel
|
||||||
vars:
|
|
||||||
tox_envlist: ansible-2.12
|
|
||||||
|
|
||||||
# Stable branches tests
|
# Stable branches tests
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-xena-ansible-2.12
|
name: ansible-collections-openstack-functional-devstack-xena-ansible-2.12
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a xena devstack
|
Run openstack collections functional tests against a xena devstack
|
||||||
using xena brach of openstacksdk and stable 2.12 branch of ansible
|
using xena branch of openstacksdk and stable 2.12 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/xena
|
override-checkout: stable/xena
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.12
|
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
|
- name: openstack/openstacksdk
|
||||||
override-checkout: stable/xena
|
override-checkout: stable/xena
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.12
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-wallaby-ansible-2.12
|
name: ansible-collections-openstack-functional-devstack-wallaby-ansible-2.12
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a wallaby devstack
|
Run openstack collections functional tests against a wallaby devstack
|
||||||
using wallaby brach of openstacksdk and stable 2.12 branch of ansible
|
using wallaby branch of openstacksdk and stable 2.12 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/wallaby
|
override-checkout: stable/wallaby
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.12
|
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
|
- name: openstack/openstacksdk
|
||||||
override-checkout: stable/wallaby
|
override-checkout: stable/wallaby
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.12
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-victoria-ansible-2.12
|
name: ansible-collections-openstack-functional-devstack-victoria-ansible-2.12
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a victoria devstack
|
Run openstack collections functional tests against a victoria devstack
|
||||||
using victoria brach of openstacksdk and stable 2.12 branch of ansible
|
using victoria branch of openstacksdk and stable 2.12 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/victoria
|
override-checkout: stable/victoria
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.12
|
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
|
- name: openstack/openstacksdk
|
||||||
override-checkout: stable/victoria
|
override-checkout: stable/victoria
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.12
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-ussuri-ansible-2.11
|
name: ansible-collections-openstack-functional-devstack-ussuri-ansible-2.11
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a ussuri devstack
|
Run openstack collections functional tests against a ussuri devstack
|
||||||
using ussuri brach of openstacksdk and stable 2.11 branch of ansible
|
using ussuri branch of openstacksdk and stable 2.11 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/ussuri
|
override-checkout: stable/ussuri
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.11
|
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
|
- name: openstack/openstacksdk
|
||||||
override-checkout: stable/ussuri
|
override-checkout: stable/ussuri
|
||||||
- name: openstack/os-client-config
|
|
||||||
override-checkout: stable/ussuri
|
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.11
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-train-ansible-2.11
|
name: ansible-collections-openstack-functional-devstack-train-ansible-2.11
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a train devstack
|
Run openstack collections functional tests against a train devstack
|
||||||
using train brach of openstacksdk and stable 2.11 branch of ansible
|
using train branch of openstacksdk and stable 2.11 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/train
|
override-checkout: stable/train
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.11
|
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
|
- name: openstack/openstacksdk
|
||||||
override-checkout: stable/train
|
override-checkout: stable/train
|
||||||
- name: openstack/os-client-config
|
|
||||||
override-checkout: stable/train
|
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.11
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-collections-openstack-functional-devstack-queens-ansible-2.11
|
name: ansible-collections-openstack-functional-devstack-queens-ansible-2.11
|
||||||
parent: ansible-collections-openstack-functional-devstack-ansible-devel
|
# 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
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections functional tests against a queens devstack
|
Run openstack collections functional tests against a queens devstack
|
||||||
using master branch of openstacksdk and stable 2.11 branch of ansible
|
using train branch of openstacksdk and stable 2.11 branch of ansible
|
||||||
voting: true
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/queens
|
override-checkout: stable/queens
|
||||||
|
# job.override-checkout will not override job.required-projects.override-checkout in parent jobs
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.11
|
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
|
- name: openstack/openstacksdk
|
||||||
# Run queens with highest possible py2 version of SDK
|
# Run queens with highest possible py2 version of SDK
|
||||||
override-checkout: stable/train
|
override-checkout: stable/train
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: ansible
|
tox_envlist: ansible-2.11
|
||||||
tox_install_siblings: true
|
|
||||||
|
|
||||||
# Linters
|
# Linters
|
||||||
- job:
|
- job:
|
||||||
name: openstack-tox-linters-ansible-devel
|
name: openstack-tox-linters-ansible
|
||||||
parent: openstack-tox-linters
|
parent: openstack-tox-linters
|
||||||
nodeset: ubuntu-focal
|
nodeset: ubuntu-focal
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections linter tests using the devel branch of ansible
|
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:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: devel
|
override-checkout: devel
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: linters-2.12
|
# 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:
|
||||||
python_version: 3.8
|
python_version: 3.8
|
||||||
bindep_profile: test py38
|
bindep_profile: test py38
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-tox-linters-ansible-2.12
|
name: openstack-tox-linters-ansible-2.12
|
||||||
parent: openstack-tox-linters
|
parent: openstack-tox-linters-ansible
|
||||||
nodeset: ubuntu-focal
|
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections linter tests using the 2.12 branch of ansible
|
Run openstack collections linter tests using the 2.12 branch of ansible
|
||||||
voting: true
|
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.12
|
override-checkout: stable-2.12
|
||||||
@@ -286,11 +490,10 @@
|
|||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-tox-linters-ansible-2.9
|
name: openstack-tox-linters-ansible-2.9
|
||||||
parent: openstack-tox-linters
|
parent: openstack-tox-linters-ansible
|
||||||
nodeset: ubuntu-bionic
|
nodeset: ubuntu-bionic
|
||||||
description: |
|
description: |
|
||||||
Run openstack collections linter tests using the 2.9 branch of ansible
|
Run openstack collections linter tests using the 2.9 branch of ansible
|
||||||
voting: true
|
|
||||||
required-projects:
|
required-projects:
|
||||||
- name: github.com/ansible/ansible
|
- name: github.com/ansible/ansible
|
||||||
override-checkout: stable-2.9
|
override-checkout: stable-2.9
|
||||||
@@ -303,12 +506,17 @@
|
|||||||
parent: bifrost-integration-tinyipa-ubuntu-focal
|
parent: bifrost-integration-tinyipa-ubuntu-focal
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/ansible-collections-openstack
|
- 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:
|
- job:
|
||||||
name: bifrost-keystone-collections-src
|
name: bifrost-keystone-collections-src
|
||||||
parent: bifrost-integration-tinyipa-keystone-ubuntu-focal
|
parent: bifrost-integration-tinyipa-keystone-ubuntu-focal
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/ansible-collections-openstack
|
- 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
|
# TripleO jobs
|
||||||
- job:
|
- job:
|
||||||
@@ -318,6 +526,11 @@
|
|||||||
featureset: '052'
|
featureset: '052'
|
||||||
consumer_job: false
|
consumer_job: false
|
||||||
build_container_images: true
|
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
|
irrelevant-files: &irr_files
|
||||||
- .*molecule.*
|
- .*molecule.*
|
||||||
- ^.*\.md$
|
- ^.*\.md$
|
||||||
@@ -329,7 +542,6 @@
|
|||||||
- ^tests/.*$
|
- ^tests/.*$
|
||||||
- ^tools/.*$
|
- ^tools/.*$
|
||||||
- ^requirements.*$
|
- ^requirements.*$
|
||||||
- ^test-requirements.*$
|
|
||||||
- ^setup.*$
|
- ^setup.*$
|
||||||
- tox.ini
|
- tox.ini
|
||||||
# Run only on files used in TripleO
|
# Run only on files used in TripleO
|
||||||
@@ -363,6 +575,7 @@
|
|||||||
- job:
|
- job:
|
||||||
name: tripleo-ci-centos-8-standalone-train-osa
|
name: tripleo-ci-centos-8-standalone-train-osa
|
||||||
parent: tripleo-ci-centos-8-standalone-osa
|
parent: tripleo-ci-centos-8-standalone-osa
|
||||||
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/train
|
override-checkout: stable/train
|
||||||
vars:
|
vars:
|
||||||
branch_override: stable/train
|
branch_override: stable/train
|
||||||
@@ -370,6 +583,7 @@
|
|||||||
- job:
|
- job:
|
||||||
name: tripleo-ci-centos-8-standalone-wallaby-osa
|
name: tripleo-ci-centos-8-standalone-wallaby-osa
|
||||||
parent: tripleo-ci-centos-8-standalone-osa
|
parent: tripleo-ci-centos-8-standalone-osa
|
||||||
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/wallaby
|
override-checkout: stable/wallaby
|
||||||
vars:
|
vars:
|
||||||
branch_override: stable/wallaby
|
branch_override: stable/wallaby
|
||||||
@@ -377,7 +591,7 @@
|
|||||||
- job:
|
- job:
|
||||||
name: tripleo-ci-centos-9-standalone-wallaby-osa
|
name: tripleo-ci-centos-9-standalone-wallaby-osa
|
||||||
parent: tripleo-ci-centos-9-standalone-osa
|
parent: tripleo-ci-centos-9-standalone-osa
|
||||||
branches: ^(stable/1.0.0|master).*$
|
branches: stable/1.0.0
|
||||||
override-checkout: stable/wallaby
|
override-checkout: stable/wallaby
|
||||||
vars:
|
vars:
|
||||||
branch_override: stable/wallaby
|
branch_override: stable/wallaby
|
||||||
@@ -417,6 +631,7 @@
|
|||||||
- tox-pep8
|
- tox-pep8
|
||||||
- openstack-tox-linters-ansible-2.9
|
- openstack-tox-linters-ansible-2.9
|
||||||
- openstack-tox-linters-ansible-2.12
|
- openstack-tox-linters-ansible-2.12
|
||||||
|
voting: false
|
||||||
|
|
||||||
- ansible-collections-openstack-functional-devstack-releases:
|
- ansible-collections-openstack-functional-devstack-releases:
|
||||||
dependencies: *deps_unit_lint
|
dependencies: *deps_unit_lint
|
||||||
@@ -432,7 +647,6 @@
|
|||||||
dependencies: *deps_unit_lint
|
dependencies: *deps_unit_lint
|
||||||
- ansible-collections-openstack-functional-devstack-train-ansible-2.11:
|
- ansible-collections-openstack-functional-devstack-train-ansible-2.11:
|
||||||
dependencies: *deps_unit_lint
|
dependencies: *deps_unit_lint
|
||||||
voting: false
|
|
||||||
- ansible-collections-openstack-functional-devstack-octavia:
|
- ansible-collections-openstack-functional-devstack-octavia:
|
||||||
dependencies: *deps_unit_lint
|
dependencies: *deps_unit_lint
|
||||||
|
|
||||||
@@ -465,13 +679,13 @@
|
|||||||
- tox-pep8
|
- tox-pep8
|
||||||
- openstack-tox-linters-ansible-2.12
|
- openstack-tox-linters-ansible-2.12
|
||||||
- openstack-tox-linters-ansible-2.9
|
- 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-releases
|
||||||
- ansible-collections-openstack-functional-devstack-ansible-2.9
|
# - ansible-collections-openstack-functional-devstack-ansible-2.9
|
||||||
- ansible-collections-openstack-functional-devstack-ansible-2.12
|
# - ansible-collections-openstack-functional-devstack-ansible-2.12
|
||||||
- ansible-collections-openstack-functional-devstack-wallaby-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-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
|
- ansible-collections-openstack-functional-devstack-octavia
|
||||||
- tripleo-ci-centos-8-standalone-wallaby-osa
|
- tripleo-ci-centos-8-standalone-wallaby-osa
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,67 @@ Openstack Cloud Ansilbe modules Release Notes
|
|||||||
.. contents:: Topics
|
.. 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
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
|
||||||
|
Minor Changes
|
||||||
|
-------------
|
||||||
|
|
||||||
|
- lb_member - Add monitor_[address,port] parameter
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- openstack_inventory - Fix documentation
|
||||||
|
- quota - Fix description of volumes_types parameter
|
||||||
|
|
||||||
v1.7.0
|
v1.7.0
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ For using the Openstack Cloud collection firstly you need to install `ansible` a
|
|||||||
For example with pip:
|
For example with pip:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install ansible openstacksdk
|
pip install "ansible>=2.9" "openstacksdk>=0.36"
|
||||||
```
|
```
|
||||||
|
|
||||||
OpenStackSDK has to be available to Ansible and to the Python interpreter on the host, where Ansible executes the module (target host).
|
OpenStackSDK has to be available to Ansible and to the Python interpreter on the host, where Ansible executes the module (target host).
|
||||||
|
|||||||
@@ -304,3 +304,40 @@ releases:
|
|||||||
name: baremetal_port_info
|
name: baremetal_port_info
|
||||||
namespace: ''
|
namespace: ''
|
||||||
release_date: '2022-02-15'
|
release_date: '2022-02-15'
|
||||||
|
1.7.1:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- openstack_inventory - Fix documentation
|
||||||
|
- quota - Fix description of volumes_types parameter
|
||||||
|
minor_changes:
|
||||||
|
- 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'
|
||||||
|
|||||||
33
ci/roles/compute_flavor_info/tasks/main.yml
Normal file
33
ci/roles/compute_flavor_info/tasks/main.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
- 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'
|
||||||
@@ -9,3 +9,13 @@
|
|||||||
that:
|
that:
|
||||||
- fips is success
|
- fips is success
|
||||||
- fips is not changed
|
- 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'
|
||||||
|
|||||||
@@ -7,6 +7,13 @@
|
|||||||
register: result
|
register: result
|
||||||
failed_when: "result.openstack_compute_services | length <= 0"
|
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
|
- name: Get nova conductor services info
|
||||||
openstack.cloud.compute_service_info:
|
openstack.cloud.compute_service_info:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
|
|||||||
@@ -41,4 +41,4 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- stacks is defined
|
- stacks is defined
|
||||||
- stacks['stacks']|length == 0
|
- (stacks['stacks']|length == 0) or (stacks['stacks'][0]['status'] == 'DELETE_COMPLETE')
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
server_network: private
|
server_network: private
|
||||||
server_name: ansible_server
|
server_name: ansible_server
|
||||||
|
server_alt_network: private_alt
|
||||||
|
server_alt_subnet: subnet_alt
|
||||||
|
server_alt_name: ansible_server_alt
|
||||||
flavor: m1.tiny
|
flavor: m1.tiny
|
||||||
floating_ip_pool_name: public
|
floating_ip_pool_name: public
|
||||||
boot_volume_size: 5
|
boot_volume_size: 5
|
||||||
|
|||||||
@@ -518,3 +518,95 @@
|
|||||||
that:
|
that:
|
||||||
- info24.openstack_servers.0.status == 'ACTIVE'
|
- info24.openstack_servers.0.status == 'ACTIVE'
|
||||||
- server is not changed
|
- 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
|
||||||
|
|||||||
5
ci/roles/subnet_pool/defaults/main.yml
Normal file
5
ci/roles/subnet_pool/defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
subnet_pool_name: "subnet_pool"
|
||||||
|
address_scope_name: "address_scope"
|
||||||
|
default_prefix_length: 24
|
||||||
|
minimum_prefix_length: 10
|
||||||
|
maximum_prefix_length: 30
|
||||||
73
ci/roles/subnet_pool/tasks/main.yaml
Normal file
73
ci/roles/subnet_pool/tasks/main.yaml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
@@ -6,20 +6,22 @@
|
|||||||
#
|
#
|
||||||
# tox -e ansible [TAG ...]
|
# tox -e ansible [TAG ...]
|
||||||
# or
|
# or
|
||||||
# tox -e ansible -- -c cloudX [TAG ...]
|
# tox -e ansible -- -c cloudX -u cloudY [TAG ...]
|
||||||
# or to use the development version of Ansible:
|
# or to use the development version of Ansible:
|
||||||
# tox -e ansible -- -d -c cloudX [TAG ...]
|
# tox -e ansible -- -d -c cloudX -u cloudY [TAG ...]
|
||||||
#
|
#
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# run-ansible-tests.sh -e ENVDIR [-d] [-c CLOUD] [TAG ...]
|
# run-ansible-tests.sh -e ENVDIR [-d] [-c CLOUD] [-u CLOUD_ALT] [TAG ...]
|
||||||
#
|
#
|
||||||
# PARAMETERS:
|
# PARAMETERS:
|
||||||
# -d Use Ansible source repo development branch.
|
# -d Use Ansible source repo development branch.
|
||||||
# -e ENVDIR Directory of the tox environment to use for testing.
|
# -e ENVDIR Directory of the tox environment to use for testing.
|
||||||
# -c CLOUD Name of the cloud to use for testing.
|
# -c CLOUD Name of the cloud to use for testing.
|
||||||
# Defaults to "devstack-admin".
|
# Defaults to "devstack-admin".
|
||||||
# [TAG ...] Optional list of space-separated tags to control which
|
# -u CLOUD_ALT Name of another cloud to use for testing.
|
||||||
# modules are tested.
|
# Defaults to "devstack-alt".
|
||||||
|
# [TAG ...] Optional list of space-separated tags to control which
|
||||||
|
# modules are tested.
|
||||||
#
|
#
|
||||||
# EXAMPLES:
|
# EXAMPLES:
|
||||||
# # Run all Ansible tests
|
# # Run all Ansible tests
|
||||||
@@ -31,14 +33,16 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
CLOUD="devstack-admin"
|
CLOUD="devstack-admin"
|
||||||
|
CLOUD_ALT="devstack-alt"
|
||||||
ENVDIR=
|
ENVDIR=
|
||||||
USE_DEV=0
|
USE_DEV=0
|
||||||
|
|
||||||
while getopts "c:de:" opt
|
while getopts "c:de:u:" opt
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
d) USE_DEV=1 ;;
|
d) USE_DEV=1 ;;
|
||||||
c) CLOUD=${OPTARG} ;;
|
c) CLOUD=${OPTARG} ;;
|
||||||
|
u) CLOUD_ALT=${OPTARG} ;;
|
||||||
e) ENVDIR=${OPTARG} ;;
|
e) ENVDIR=${OPTARG} ;;
|
||||||
?) echo "Invalid option: -${OPTARG}"
|
?) echo "Invalid option: -${OPTARG}"
|
||||||
exit 1;;
|
exit 1;;
|
||||||
@@ -134,6 +138,6 @@ pushd ci/
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \
|
ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \
|
||||||
-vvv ./run-collection.yml \
|
-vvv ./run-collection.yml \
|
||||||
-e "sdk_version=${SDK_VER} cloud=${CLOUD} image=${IMAGE} ${ANSIBLE_VARS}" \
|
-e "sdk_version=${SDK_VER} cloud=${CLOUD} cloud_alt=${CLOUD_ALT} image=${IMAGE} ${ANSIBLE_VARS}" \
|
||||||
${tag_opt} 2>&1 | sudo tee /opt/stack/logs/test_output.log
|
${tag_opt} 2>&1 | sudo tee /opt/stack/logs/test_output.log
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
- rbac
|
- rbac
|
||||||
- neutron_rbac
|
- neutron_rbac
|
||||||
- { role: nova_flavor, tags: nova_flavor }
|
- { role: nova_flavor, tags: nova_flavor }
|
||||||
|
- role: compute_flavor_info
|
||||||
|
tags: nova_flavor
|
||||||
- role: nova_services
|
- role: nova_services
|
||||||
tags: nova_services
|
tags: nova_services
|
||||||
when: sdk_version is version(0.44, '>=')
|
when: sdk_version is version(0.44, '>=')
|
||||||
@@ -45,6 +47,7 @@
|
|||||||
- { role: security_group, tags: security_group }
|
- { role: security_group, tags: security_group }
|
||||||
- { role: server, tags: server }
|
- { role: server, tags: server }
|
||||||
- { role: subnet, tags: subnet }
|
- { role: subnet, tags: subnet }
|
||||||
|
- { role: subnet_pool, tags: subnet_pool }
|
||||||
- { role: user, tags: user }
|
- { role: user, tags: user }
|
||||||
- { role: user_group, tags: user_group }
|
- { role: user_group, tags: user_group }
|
||||||
- { role: user_role, tags: user_role }
|
- { role: user_role, tags: user_role }
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Naming
|
|||||||
------
|
------
|
||||||
|
|
||||||
* This is a collection named ``openstack.cloud``. There is no need for further namespace prefixing.
|
* 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
|
``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
|
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.
|
not know whether their floating IPs are managed by Nova or Neutron.
|
||||||
@@ -24,6 +24,7 @@ Interface
|
|||||||
* If the resource being managed has an id, it should be returned.
|
* If the resource being managed has an id, it should be returned.
|
||||||
* If the resource being managed has an associated object more complex than
|
* If the resource being managed has an associated object more complex than
|
||||||
an id, it should also be returned.
|
an id, it should also be returned.
|
||||||
|
* Return format shall be a dictionary or list
|
||||||
|
|
||||||
Interoperability
|
Interoperability
|
||||||
----------------
|
----------------
|
||||||
@@ -53,7 +54,7 @@ Libraries
|
|||||||
* All complex cloud interaction or interoperability code should be housed in
|
* All complex cloud interaction or interoperability code should be housed in
|
||||||
the `openstacksdk <https://opendev.org/openstack/openstacksdk>`_
|
the `openstacksdk <https://opendev.org/openstack/openstacksdk>`_
|
||||||
library.
|
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
|
OpenStack Client libraries. The OpenStack Client libraries do no have end
|
||||||
users as a primary audience, they are for intra-server communication.
|
users as a primary audience, they are for intra-server communication.
|
||||||
* All modules should be registered in ``meta/action_groups.yml`` for enabling the
|
* All modules should be registered in ``meta/action_groups.yml`` for enabling the
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ build_ignore:
|
|||||||
- ansible_collections_openstack.egg-info
|
- ansible_collections_openstack.egg-info
|
||||||
- contrib
|
- contrib
|
||||||
- changelogs
|
- changelogs
|
||||||
version: 1.7.0
|
version: 1.8.0
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ build_ignore:
|
|||||||
- ci
|
- ci
|
||||||
- galaxy.yml.in
|
- galaxy.yml.in
|
||||||
- setup.cfg
|
- setup.cfg
|
||||||
- test-requirements.txt
|
- test-requirements*
|
||||||
- tests
|
- tests
|
||||||
- tools
|
- tools
|
||||||
- tox.ini
|
- tox.ini
|
||||||
@@ -29,7 +29,7 @@ build_ignore:
|
|||||||
- importer_result.json
|
- importer_result.json
|
||||||
- .tox
|
- .tox
|
||||||
- .env
|
- .env
|
||||||
|
- .vscode
|
||||||
- ansible_collections_openstack.egg-info
|
- ansible_collections_openstack.egg-info
|
||||||
- contrib
|
- contrib
|
||||||
- changelogs/.plugin-cache.yaml
|
- changelogs
|
||||||
- changelogs/fragments
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ action_groups:
|
|||||||
- stack
|
- stack
|
||||||
- subnet
|
- subnet
|
||||||
- subnets_info
|
- subnets_info
|
||||||
|
- subnet_pool
|
||||||
- volume
|
- volume
|
||||||
- volume_backup
|
- volume_backup
|
||||||
- volume_backup_info
|
- volume_backup_info
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ options:
|
|||||||
show_all:
|
show_all:
|
||||||
description: toggles showing all vms vs only those with a working IP
|
description: toggles showing all vms vs only those with a working IP
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
inventory_hostname:
|
inventory_hostname:
|
||||||
description: |
|
description: |
|
||||||
What to register as the inventory hostname.
|
What to register as the inventory hostname.
|
||||||
@@ -47,7 +47,7 @@ options:
|
|||||||
'ansible_ssh_host' facts. This might be desired when using jump or
|
'ansible_ssh_host' facts. This might be desired when using jump or
|
||||||
bastion hosts and the name is the FQDN of the host.
|
bastion hosts and the name is the FQDN of the host.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
expand_hostvars:
|
expand_hostvars:
|
||||||
description: |
|
description: |
|
||||||
Run extra commands on each host to fill in additional
|
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
|
(Note, the default value of this is opposite from the default
|
||||||
old openstack.py inventory script's option expand_hostvars)
|
old openstack.py inventory script's option expand_hostvars)
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
private:
|
private:
|
||||||
description: |
|
description: |
|
||||||
Use the private interface of each server, if it has one, as
|
Use the private interface of each server, if it has one, as
|
||||||
@@ -64,12 +64,13 @@ options:
|
|||||||
running ansible inside a server in the cloud and would rather
|
running ansible inside a server in the cloud and would rather
|
||||||
communicate to your servers over the private network.
|
communicate to your servers over the private network.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
only_clouds:
|
only_clouds:
|
||||||
description: |
|
description: |
|
||||||
List of clouds from clouds.yaml to use, instead of using
|
List of clouds from clouds.yaml to use, instead of using
|
||||||
the whole list.
|
the whole list.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
fail_on_errors:
|
fail_on_errors:
|
||||||
description: |
|
description: |
|
||||||
@@ -80,12 +81,12 @@ options:
|
|||||||
default value of this is opposite from the old openstack.py
|
default value of this is opposite from the old openstack.py
|
||||||
inventory script's option fail_on_errors)
|
inventory script's option fail_on_errors)
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
all_projects:
|
all_projects:
|
||||||
description: |
|
description: |
|
||||||
Lists servers from all projects
|
Lists servers from all projects
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
clouds_yaml_path:
|
clouds_yaml_path:
|
||||||
description: |
|
description: |
|
||||||
Override path to clouds.yaml file. If this value is given it
|
Override path to clouds.yaml file. If this value is given it
|
||||||
@@ -94,6 +95,7 @@ options:
|
|||||||
/etc/ansible/openstack.yml to the regular locations documented
|
/etc/ansible/openstack.yml to the regular locations documented
|
||||||
at https://docs.openstack.org/os-client-config/latest/user/configuration.html#config-files
|
at https://docs.openstack.org/os-client-config/latest/user/configuration.html#config-files
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
env:
|
env:
|
||||||
- name: OS_CLIENT_CONFIG_FILE
|
- name: OS_CLIENT_CONFIG_FILE
|
||||||
compose:
|
compose:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ options:
|
|||||||
ip_version:
|
ip_version:
|
||||||
description:
|
description:
|
||||||
- The IP version of the subnet 4 or 6
|
- The IP version of the subnet 4 or 6
|
||||||
default: 4
|
default: '4'
|
||||||
type: str
|
type: str
|
||||||
choices: ['4', '6']
|
choices: ['4', '6']
|
||||||
shared:
|
shared:
|
||||||
|
|||||||
@@ -126,6 +126,29 @@ openstack_flavors:
|
|||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "tiny"
|
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:
|
disk:
|
||||||
description: Size of local disk, in GB.
|
description: Size of local disk, in GB.
|
||||||
returned: success
|
returned: success
|
||||||
@@ -196,16 +219,22 @@ class ComputeFlavorInfoModule(OpenStackModule):
|
|||||||
filters['ephemeral'] = ephemeral
|
filters['ephemeral'] = ephemeral
|
||||||
|
|
||||||
if name:
|
if name:
|
||||||
flavors = self.conn.search_flavors(filters={'name': 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 []
|
||||||
|
|
||||||
else:
|
else:
|
||||||
flavors = self.conn.list_flavors()
|
flavors = list(self.conn.compute.flavors())
|
||||||
if filters:
|
if filters:
|
||||||
flavors = self.conn.range_search(flavors, filters)
|
flavors = self.conn.range_search(flavors, filters)
|
||||||
|
|
||||||
if limit is not None:
|
if limit is not None:
|
||||||
flavors = flavors[:limit]
|
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)
|
self.exit_json(changed=False, openstack_flavors=flavors)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,22 @@ openstack_compute_services:
|
|||||||
description: The name of the host.
|
description: The name of the host.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
zone:
|
disabled_reason:
|
||||||
|
description: The reason why the service is disabled
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
|
availability_zone:
|
||||||
description: The availability zone name.
|
description: The availability zone name.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
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:
|
status:
|
||||||
description: The status of the service. One of enabled or disabled.
|
description: The status of the service. One of enabled or disabled.
|
||||||
returned: success
|
returned: success
|
||||||
@@ -71,7 +83,7 @@ openstack_compute_services:
|
|||||||
description: The state of the service. One of up or down.
|
description: The state of the service. One of up or down.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
update:
|
update_at:
|
||||||
description: The date and time when the resource was updated
|
description: The date and time when the resource was updated
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
@@ -98,7 +110,7 @@ class ComputeServiceInfoModule(OpenStackModule):
|
|||||||
if host:
|
if host:
|
||||||
filters['host'] = host
|
filters['host'] = host
|
||||||
services = self.conn.compute.services(**filters)
|
services = self.conn.compute.services(**filters)
|
||||||
services = list(services)
|
services = [service.to_dict(computed=True) for service in services]
|
||||||
self.exit_json(changed=False, openstack_compute_services=services)
|
self.exit_json(changed=False, openstack_compute_services=services)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,6 @@ class FloatingIPInfoModule(OpenStackModule):
|
|||||||
router = self.params['router']
|
router = self.params['router']
|
||||||
status = self.params['status']
|
status = self.params['status']
|
||||||
|
|
||||||
data = []
|
|
||||||
query = {}
|
query = {}
|
||||||
if description:
|
if description:
|
||||||
query['description'] = description
|
query['description'] = description
|
||||||
@@ -194,15 +193,8 @@ class FloatingIPInfoModule(OpenStackModule):
|
|||||||
if status:
|
if status:
|
||||||
query['status'] = status.upper()
|
query['status'] = status.upper()
|
||||||
|
|
||||||
for raw in self.conn.network.ips(**query):
|
ips = [ip.to_dict(computed=False) for ip in self.conn.network.ips(**query)]
|
||||||
dt = raw.to_dict()
|
self.exit_json(changed=False, floating_ips=ips)
|
||||||
dt.pop('location')
|
|
||||||
data.append(dt)
|
|
||||||
|
|
||||||
self.exit_json(
|
|
||||||
changed=False,
|
|
||||||
floating_ips=data
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -135,14 +135,14 @@ class ComputeHostAggregateModule(OpenStackModule):
|
|||||||
if hosts is None:
|
if hosts is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
hosts_to_add = set(hosts) - set(aggregate.get("hosts", []))
|
hosts_to_add = set(hosts) - set(aggregate.get("hosts") or [])
|
||||||
for i in hosts_to_add:
|
for i in hosts_to_add:
|
||||||
self.conn.add_host_to_aggregate(aggregate.id, i)
|
self.conn.add_host_to_aggregate(aggregate.id, i)
|
||||||
|
|
||||||
if not purge_hosts:
|
if not purge_hosts:
|
||||||
return
|
return
|
||||||
|
|
||||||
hosts_to_remove = set(aggregate.get("hosts", [])) - set(hosts)
|
hosts_to_remove = set(aggregate.get("hosts") or []) - set(hosts)
|
||||||
for i in hosts_to_remove:
|
for i in hosts_to_remove:
|
||||||
self.conn.remove_host_from_aggregate(aggregate.id, i)
|
self.conn.remove_host_from_aggregate(aggregate.id, i)
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Prevent image from being deleted
|
- Prevent image from being deleted
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
default: false
|
||||||
filename:
|
filename:
|
||||||
description:
|
description:
|
||||||
- The path to the file which has to be uploaded
|
- The path to the file which has to be uploaded
|
||||||
|
|||||||
@@ -88,10 +88,6 @@ openstack_image:
|
|||||||
description: Image created at timestamp.
|
description: Image created at timestamp.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
deleted:
|
|
||||||
description: Image deleted flag.
|
|
||||||
returned: success
|
|
||||||
type: bool
|
|
||||||
container_format:
|
container_format:
|
||||||
description: Container format of the image.
|
description: Container format of the image.
|
||||||
returned: success
|
returned: success
|
||||||
@@ -132,10 +128,6 @@ openstack_image:
|
|||||||
description: Is public flag of the image.
|
description: Is public flag of the image.
|
||||||
returned: success
|
returned: success
|
||||||
type: bool
|
type: bool
|
||||||
deleted_at:
|
|
||||||
description: Image deleted at timestamp.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
size:
|
size:
|
||||||
description: Size of the image.
|
description: Size of the image.
|
||||||
returned: success
|
returned: success
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ options:
|
|||||||
- The number of successful checks before changing the operating status of the member to ONLINE.
|
- The number of successful checks before changing the operating status of the member to ONLINE.
|
||||||
max_retries_down:
|
max_retries_down:
|
||||||
type: 'str'
|
type: 'str'
|
||||||
default: 3
|
default: '3'
|
||||||
description:
|
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.
|
- 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:
|
resp_timeout:
|
||||||
@@ -60,7 +60,7 @@ options:
|
|||||||
type: bool
|
type: bool
|
||||||
expected_codes:
|
expected_codes:
|
||||||
type: 'str'
|
type: 'str'
|
||||||
default: 200
|
default: '200'
|
||||||
description:
|
description:
|
||||||
- The list of HTTP status codes expected in response from the member to declare it healthy. Specify one of the following values
|
- 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
|
A single value, such as 200
|
||||||
|
|||||||
@@ -234,8 +234,7 @@ class RouterModule(OpenStackModule):
|
|||||||
missing_port_ids,
|
missing_port_ids,
|
||||||
requested_subnet_ids,
|
requested_subnet_ids,
|
||||||
existing_subnet_ids,
|
existing_subnet_ids,
|
||||||
router_ifs_cfg,
|
router_ifs_cfg):
|
||||||
filters=None):
|
|
||||||
"""Decide if the given router needs an update."""
|
"""Decide if the given router needs an update."""
|
||||||
if router['admin_state_up'] != self.params['admin_state_up']:
|
if router['admin_state_up'] != self.params['admin_state_up']:
|
||||||
return True
|
return True
|
||||||
@@ -476,8 +475,7 @@ class RouterModule(OpenStackModule):
|
|||||||
missing_port_ids,
|
missing_port_ids,
|
||||||
requested_subnet_ids,
|
requested_subnet_ids,
|
||||||
existing_subnet_ids,
|
existing_subnet_ids,
|
||||||
router_ifs_cfg,
|
router_ifs_cfg)
|
||||||
filters)
|
|
||||||
self.exit_json(changed=changed)
|
self.exit_json(changed=changed)
|
||||||
|
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
@@ -510,8 +508,7 @@ class RouterModule(OpenStackModule):
|
|||||||
missing_port_ids,
|
missing_port_ids,
|
||||||
requested_subnet_ids,
|
requested_subnet_ids,
|
||||||
existing_subnet_ids,
|
existing_subnet_ids,
|
||||||
router_ifs_cfg,
|
router_ifs_cfg):
|
||||||
filters):
|
|
||||||
changed = True
|
changed = True
|
||||||
kwargs = self._build_kwargs(router, net)
|
kwargs = self._build_kwargs(router, net)
|
||||||
updated_router = self.conn.update_router(**kwargs)
|
updated_router = self.conn.update_router(**kwargs)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- A list of tags to filter the list result by. Resources that match all tags in this list will be returned.
|
- A list of tags to filter the list result by. Resources that match all tags in this list will be returned.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 3.6"
|
- "python >= 3.6"
|
||||||
- "openstacksdk"
|
- "openstacksdk"
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Admin password for server to rebuild
|
- Admin password for server to rebuild
|
||||||
type: str
|
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:
|
requirements:
|
||||||
- "python >= 3.6"
|
- "python >= 3.6"
|
||||||
@@ -120,6 +126,7 @@ class ServerActionModule(OpenStackModule):
|
|||||||
'rebuild', 'shelve', 'shelve_offload', 'unshelve']),
|
'rebuild', 'shelve', 'shelve_offload', 'unshelve']),
|
||||||
image=dict(required=False, type='str'),
|
image=dict(required=False, type='str'),
|
||||||
admin_password=dict(required=False, type='str', no_log=True),
|
admin_password=dict(required=False, type='str', no_log=True),
|
||||||
|
all_projects=dict(required=False, type='bool', default=False),
|
||||||
)
|
)
|
||||||
module_kwargs = dict(
|
module_kwargs = dict(
|
||||||
required_if=[('action', 'rebuild', ['image'])],
|
required_if=[('action', 'rebuild', ['image'])],
|
||||||
@@ -137,7 +144,10 @@ class ServerActionModule(OpenStackModule):
|
|||||||
|
|
||||||
def _preliminary_checks(self):
|
def _preliminary_checks(self):
|
||||||
# Using Munch object for getting information about a server
|
# Using Munch object for getting information about a server
|
||||||
os_server = self.conn.get_server(self.params['server'])
|
os_server = self.conn.get_server(
|
||||||
|
self.params['server'],
|
||||||
|
all_projects=self.params['all_projects'],
|
||||||
|
)
|
||||||
if not os_server:
|
if not os_server:
|
||||||
self.fail_json(msg='Could not find server %s' % self.params['server'])
|
self.fail_json(msg='Could not find server %s' % self.params['server'])
|
||||||
# check mode
|
# check mode
|
||||||
@@ -193,8 +203,9 @@ class ServerActionModule(OpenStackModule):
|
|||||||
|
|
||||||
def _wait(self, os_server):
|
def _wait(self, os_server):
|
||||||
"""Wait for the server to reach the desired state for the given action."""
|
"""Wait for the server to reach the desired state for the given action."""
|
||||||
# Using Server object for wait_for_server function
|
# The wait_for_server function needs a Server object instead of the
|
||||||
server = self.conn.compute.find_server(self.params['server'])
|
# Munch object returned by self.conn.get_server
|
||||||
|
server = self.conn.compute.get_server(os_server['id'])
|
||||||
states = _action_map[self.params['action']]
|
states = _action_map[self.params['action']]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ options:
|
|||||||
ip_version:
|
ip_version:
|
||||||
description:
|
description:
|
||||||
- The IP version of the subnet 4 or 6
|
- The IP version of the subnet 4 or 6
|
||||||
default: 4
|
default: '4'
|
||||||
type: str
|
type: str
|
||||||
choices: ['4', '6']
|
choices: ['4', '6']
|
||||||
enable_dhcp:
|
enable_dhcp:
|
||||||
|
|||||||
345
plugins/modules/subnet_pool.py
Normal file
345
plugins/modules/subnet_pool.py
Normal file
@@ -0,0 +1,345 @@
|
|||||||
|
#!/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()
|
||||||
@@ -1 +1 @@
|
|||||||
openstacksdk>=0.13
|
openstacksdk>=0.36
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
test-requirements-2.11.txt
|
|
||||||
1
tests/constraints-none.txt
Normal file
1
tests/constraints-none.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# No constraints are defined by default
|
||||||
1
tests/constraints-openstacksdk-0.x.x.txt
Normal file
1
tests/constraints-openstacksdk-0.x.x.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
openstacksdk<1.0.0
|
||||||
1
tests/constraints-openstacksdk-1.x.x.txt
Normal file
1
tests/constraints-openstacksdk-1.x.x.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
openstacksdk>=1.0.0
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
openstacksdk
|
ansible-core>=2.11.0,<2.12.0
|
||||||
ansible-core
|
|
||||||
pycodestyle
|
|
||||||
flake8
|
flake8
|
||||||
|
galaxy-importer
|
||||||
|
openstacksdk
|
||||||
|
pycodestyle
|
||||||
pylint
|
pylint
|
||||||
voluptuous
|
|
||||||
yamllint
|
|
||||||
rstcheck
|
rstcheck
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
#galaxy-importer # see https://review.opendev.org/#/c/743054
|
|
||||||
tox
|
tox
|
||||||
|
voluptuous
|
||||||
|
yamllint
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
openstacksdk
|
ansible-core>=2.12.0,<2.13.0
|
||||||
ansible<2.10
|
|
||||||
pycodestyle
|
|
||||||
flake8
|
flake8
|
||||||
|
galaxy-importer
|
||||||
|
openstacksdk
|
||||||
|
pycodestyle
|
||||||
pylint
|
pylint
|
||||||
voluptuous
|
|
||||||
yamllint
|
|
||||||
rstcheck
|
rstcheck
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
#galaxy-importer # see https://review.opendev.org/#/c/743054
|
|
||||||
tox
|
tox
|
||||||
|
voluptuous
|
||||||
|
yamllint
|
||||||
13
tests/requirements-ansible-2.9.txt
Normal file
13
tests/requirements-ansible-2.9.txt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
openstacksdk
|
|
||||||
ansible-core
|
ansible-core
|
||||||
pycodestyle
|
|
||||||
flake8
|
flake8
|
||||||
|
galaxy-importer
|
||||||
|
openstacksdk
|
||||||
|
pycodestyle
|
||||||
pylint
|
pylint
|
||||||
voluptuous
|
|
||||||
yamllint
|
|
||||||
rstcheck
|
rstcheck
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
#galaxy-importer # see https://review.opendev.org/#/c/743054
|
|
||||||
tox
|
tox
|
||||||
|
voluptuous
|
||||||
|
yamllint
|
||||||
@@ -15,11 +15,5 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
TOXDIR=${1:-.}
|
TOXDIR="${1:-.}"
|
||||||
######### Disbaled in https://review.opendev.org/#/c/743054
|
python -m galaxy_importer.main "$TOXDIR/build_artifact/"*
|
||||||
|
|
||||||
# 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
39
tox.ini
@@ -1,6 +1,6 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 3.18.0
|
minversion = 3.18.0
|
||||||
envlist = pep8
|
envlist = linters
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
ignore_basepython_conflict = True
|
ignore_basepython_conflict = True
|
||||||
|
|
||||||
@@ -21,7 +21,8 @@ setenv =
|
|||||||
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
||||||
pip: PIP_INSTALL={env:PIP_INSTALL:true}
|
pip: PIP_INSTALL={env:PIP_INSTALL:true}
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements.txt
|
||||||
pip: {toxinidir}
|
pip: {toxinidir}
|
||||||
|
|
||||||
commands = stestr run {posargs}
|
commands = stestr run {posargs}
|
||||||
@@ -33,9 +34,10 @@ commands =
|
|||||||
|
|
||||||
[testenv:build]
|
[testenv:build]
|
||||||
deps =
|
deps =
|
||||||
|
ansible-core
|
||||||
|
galaxy-importer
|
||||||
pbr
|
pbr
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
ansible-core
|
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
python {toxinidir}/tools/build.py
|
python {toxinidir}/tools/build.py
|
||||||
@@ -57,24 +59,22 @@ commands =
|
|||||||
passenv = {[testenv:linters]passenv}
|
passenv = {[testenv:linters]passenv}
|
||||||
commands = {[testenv:linters]commands}
|
commands = {[testenv:linters]commands}
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.9.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.9.txt
|
||||||
|
|
||||||
[testenv:linters-2.11]
|
[testenv:linters-2.11]
|
||||||
passenv = {[testenv:linters]passenv}
|
passenv = {[testenv:linters]passenv}
|
||||||
commands = {[testenv:linters]commands}
|
commands = {[testenv:linters]commands}
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.11.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.11.txt
|
||||||
|
|
||||||
[testenv:linters-2.12]
|
[testenv:linters-2.12]
|
||||||
passenv = {[testenv:linters]passenv}
|
passenv = {[testenv:linters]passenv}
|
||||||
commands = {[testenv:linters]commands}
|
commands = {[testenv:linters]commands}
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.12.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.12.txt
|
||||||
[testenv:venv]
|
|
||||||
deps =
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
|
||||||
commands = {posargs}
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
|
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
|
||||||
@@ -98,29 +98,24 @@ deps =
|
|||||||
commands =
|
commands =
|
||||||
/bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs}
|
/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]
|
[testenv:ansible-2.9]
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.9.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.9.txt
|
||||||
passenv = {[testenv:ansible]passenv}
|
passenv = {[testenv:ansible]passenv}
|
||||||
commands = {[testenv:ansible]commands}
|
commands = {[testenv:ansible]commands}
|
||||||
|
|
||||||
[testenv:ansible-2.11]
|
[testenv:ansible-2.11]
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.11.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.11.txt
|
||||||
passenv = {[testenv:ansible]passenv}
|
passenv = {[testenv:ansible]passenv}
|
||||||
commands = {[testenv:ansible]commands}
|
commands = {[testenv:ansible]commands}
|
||||||
|
|
||||||
[testenv:ansible-2.12]
|
[testenv:ansible-2.12]
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements-2.12.txt
|
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt}
|
||||||
|
-r{toxinidir}/tests/requirements-ansible-2.12.txt
|
||||||
passenv = {[testenv:ansible]passenv}
|
passenv = {[testenv:ansible]passenv}
|
||||||
commands = {[testenv:ansible]commands}
|
commands = {[testenv:ansible]commands}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user