diff --git a/playbooks/files/list_containers.py b/playbooks/files/list_containers.py new file mode 100644 index 0000000..e7ecd04 --- /dev/null +++ b/playbooks/files/list_containers.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import openstack + +from otcextensions import sdk + +openstack.enable_logging(True) +conn = openstack.connect() +sdk.register_otc_extensions(conn) + +list(conn.obs.containers()) diff --git a/playbooks/scenario32_obs.yaml b/playbooks/scenario32_obs.yaml new file mode 100644 index 0000000..610bf5d --- /dev/null +++ b/playbooks/scenario32_obs.yaml @@ -0,0 +1,9 @@ +--- +- name: Scenario 32 - list of containers obs + hosts: localhost + ignore_errors: yes + tasks: + - name: List of containers + script: "list_containers.py" + args: + executable: python3 diff --git a/roles/vpc/tasks/main.yml b/roles/vpc/tasks/main.yml index 9345739..1b693f0 100644 --- a/roles/vpc/tasks/main.yml +++ b/roles/vpc/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for otc-vpc-role # Create - block: - - include: "{{ net_task }}.yaml" + - ansible.builtin.include_tasks: "{{ net_task }}.yaml" loop_control: loop_var: net_task with_items: "{{ task_manager }}" @@ -18,7 +18,7 @@ # Remove - block: - - include: "{{ net_task }}.yaml" + - ansible.builtin.include_tasks: "{{ net_task }}.yaml" loop_control: loop_var: net_task with_items: "{{ task_manager | reverse | list }}" diff --git a/tox.ini b/tox.ini index 7fb34c0..7b6a0a5 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ install_command = pip install {opts} {packages} [testenv:linters] deps = - ansible + ansible==5.8.0 ansible-lint yamllint flake8