Adding container engine to kolla_container_facts

Second part of patchset:
https://review.opendev.org/c/openstack/kolla-ansible/+/799229/
in which was suggested to split patch into smaller ones.

This change adds container_engine variable to kolla_container_facts
module, this prepares module to be used with docker and podman as well
without further changes in roles.

Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com>
Co-authored-by: Martin Hiner <m.hiner@partner.samsung.com>
Change-Id: I9e8fa30646844ab4a288555f3aafdda345b3a118
This commit is contained in:
Ivan Halomi 2022-10-28 13:01:47 +02:00
parent 910f9bd36f
commit 7a9f04573a
59 changed files with 66 additions and 1 deletions

View File

@ -27,6 +27,11 @@ description:
- A module targeting at collecting Docker container facts. It is used for - A module targeting at collecting Docker container facts. It is used for
detecting whether the container is running on host in Kolla. detecting whether the container is running on host in Kolla.
options: options:
container_engine:
description:
- Name of container engine to use
required: True
type: str
api_version: api_version:
description: description:
- The version of the api for docker-py to use when contacting docker - The version of the api for docker-py to use when contacting docker
@ -49,6 +54,7 @@ EXAMPLES = '''
- name: Gather glance container facts - name: Gather glance container facts
kolla_container_facts: kolla_container_facts:
container_engine: docker
name: name:
- glance_api - glance_api
- glance_registry - glance_registry
@ -62,7 +68,8 @@ def get_docker_client():
def main(): def main():
argument_spec = dict( argument_spec = dict(
name=dict(required=False, type='list', default=[]), name=dict(required=False, type='list', default=[]),
api_version=dict(required=False, type='str', default='auto') api_version=dict(required=False, type='str', default='auto'),
container_engine=dict(required=True, type='str')
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- aodh_api - aodh_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- barbican_api - barbican_api
register: container_facts register: container_facts

View File

@ -3,6 +3,7 @@
- name: Check if bifrost_deploy container is running - name: Check if bifrost_deploy container is running
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- bifrost_deploy - bifrost_deploy
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- blazar_api - blazar_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- cinder_api - cinder_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- cloudkitty_api - cloudkitty_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- cyborg_api - cyborg_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- designate_api - designate_api
- designate_backend_bind9 - designate_backend_bind9

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- elasticsearch - elasticsearch
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- etcd - etcd
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- freezer_api - freezer_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: "{{ glance_services.values() | map(attribute='container_name') | list }}" name: "{{ glance_services.values() | map(attribute='container_name') | list }}"
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- gnocchi_api - gnocchi_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- grafana - grafana
register: container_facts register: container_facts

View File

@ -2,6 +2,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- hacluster_pacemaker_remote - hacluster_pacemaker_remote
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- heat_api - heat_api
- heat_api_cfn - heat_api_cfn

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- horizon - horizon
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- influxdb - influxdb
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- ironic_api - ironic_api
- ironic_inspector - ironic_inspector

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- iscsid - iscsid
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- kafka - kafka
register: container_facts register: container_facts

View File

@ -2,6 +2,7 @@
- name: Checking for any running keystone_fernet containers - name: Checking for any running keystone_fernet containers
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- keystone_fernet - keystone_fernet
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- keystone - keystone
- keystone_ssh - keystone_ssh

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- kibana - kibana
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- kuryr - kuryr
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- haproxy - haproxy
- proxysql - proxysql

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- magnum_api - magnum_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- manila_api - manila_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- mariadb - mariadb
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- masakari_api - masakari_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- memcached - memcached
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- mistral_api - mistral_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: "{{ monasca_services.values() | map(attribute='container_name') | list }}" name: "{{ monasca_services.values() | map(attribute='container_name') | list }}"
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- murano_api - murano_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- neutron_server - neutron_server
register: container_facts register: container_facts

View File

@ -9,6 +9,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- nova_libvirt - nova_libvirt
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- nova_libvirt - nova_libvirt
- nova_novncproxy - nova_novncproxy

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- nova_api - nova_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- octavia_api - octavia_api
- octavia_health_manager - octavia_health_manager

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- openvswitch_db - openvswitch_db
register: container_facts register: container_facts

View File

@ -2,6 +2,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- ovn_nb_db - ovn_nb_db
- ovn_sb_db - ovn_sb_db

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- placement_api - placement_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- prometheus_server - prometheus_server
- prometheus_node_exporter - prometheus_node_exporter

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- rabbitmq - rabbitmq
- outward_rabbitmq - outward_rabbitmq

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- redis - redis
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- sahara_api - sahara_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- senlin_api - senlin_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- skydive_analyzer - skydive_analyzer
- skydive_agent - skydive_agent

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- solum_api - solum_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- storm_worker - storm_worker
- storm_nimbus - storm_nimbus

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- swift_account_server - swift_account_server
- swift_container_server - swift_container_server

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- tacker_server - tacker_server
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- trove_api - trove_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- venus_api - venus_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- vitrage_api - vitrage_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- watcher_api - watcher_api
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- zookeeper - zookeeper
register: container_facts register: container_facts

View File

@ -8,6 +8,7 @@
- name: Get container facts - name: Get container facts
become: true become: true
kolla_container_facts: kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name: name:
- zun_api - zun_api
- zun_wsproxy - zun_wsproxy