diff --git a/ansible/library/kolla_container_facts.py b/ansible/library/kolla_container_facts.py index ef3617db26..7e2254e514 100644 --- a/ansible/library/kolla_container_facts.py +++ b/ansible/library/kolla_container_facts.py @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from abc import ABC +from abc import abstractmethod from ansible.module_utils.basic import AnsibleModule +from traceback import format_exc DOCUMENTATION = ''' @@ -40,9 +42,9 @@ options: - Name or names of the containers required: False type: str or list - container_engine: + action: description: - - Name of container engine to use + - The action to perform required: True type: str author: Jeffrey Zhang @@ -54,6 +56,7 @@ EXAMPLES = ''' - name: Gather docker facts kolla_container_facts: container_engine: docker + action: get_containers - name: Gather glance container facts kolla_container_facts: @@ -62,70 +65,103 @@ EXAMPLES = ''' - glance_api - glance_registry container_engine: podman + action: get_containers ''' -def get_docker_client(): - import docker - return docker.APIClient +class ContainerFactsWorker(ABC): + def __init__(self, module): + self.module = module + self.results = dict(changed=False, _containers=[]) + self.params = module.params + + @abstractmethod + def get_containers(self): + pass -def use_docker(module, results): - client = get_docker_client()(version=module.params.get('api_version')) +class DockerFactsWorker(ContainerFactsWorker): + def __init__(self, module): + super().__init__(module) + try: + import docker + except ImportError: + self.module.fail_json( + msg="The docker library could not be imported") + self.client = docker.APIClient(version=module.params.get( + 'api_version')) - containers = client.containers() - names = module.params.get('name') - if names and not isinstance(names, list): - names = [names] - for container in containers: - for container_name in container['Names']: - # remove '/' prefix character - container_name = container_name[1:] - if names and container_name not in names: + def get_containers(self): + containers = self.client.containers() + names = self.params.get('name') + if names and not isinstance(names, list): + names = [names] + for container in containers: + for container_name in container['Names']: + # remove '/' prefix character + container_name = container_name[1:] + if names and container_name not in names: + continue + self.results['_containers'].append(container) + self.results[container_name] = container + + +class PodmanFactsWorker(ContainerFactsWorker): + def __init__(self, module): + try: + import podman.errors as podmanError + from podman import PodmanClient + except ImportError: + self.module.fail_json( + msg="The podman library could not be imported") + self.podmanError = podmanError + super().__init__(module) + self.client = PodmanClient( + base_url="http+unix:/run/podman/podman.sock") + + def get_containers(self): + try: + containers = self.client.containers.list( + all=True, ignore_removed=True) + except self.podmanError.APIError as e: + self.module.fail_json(failed=True, + msg=f"Internal error: {e.explanation}") + names = self.params.get('name') + if names and not isinstance(names, list): + names = [names] + + for container in containers: + container.reload() + container_name = container.attrs['Name'] + if container_name not in names: continue - results['_containers'].append(container) - results[container_name] = container - - -def use_podman(module, results): - import podman.errors as pe - from podman import PodmanClient - - client = PodmanClient(base_url="http+unix:/run/podman/podman.sock") - - try: - containers = client.containers.list(all=True, ignore_removed=True) - except pe.APIError as e: - module.fail_json(failed=True, msg=f"Internal error: {e.explanation}") - names = module.params.get('name') - if names and not isinstance(names, list): - names = [names] - - for container in containers: - container.reload() - container_name = container.attrs['Name'] - if names and container_name not in names: - continue - results['_containers'].append(container.attrs) - results[container_name] = container.attrs + self.results['_containers'].append(container.attrs) + self.results[container_name] = container.attrs def main(): argument_spec = dict( name=dict(required=False, type='list', default=[]), api_version=dict(required=False, type='str', default='auto'), - container_engine=dict(required=True, type='str') + container_engine=dict(required=True, type='str'), + action=dict(required=True, type='str', + choices=['get_containers']), ) module = AnsibleModule(argument_spec=argument_spec) - results = dict(changed=False, _containers=[]) - if module.params['container_engine'] == 'podman': - use_podman(module, results) - else: - use_docker(module, results) + cw: ContainerFactsWorker = None + try: + if module.params.get('container_engine') == 'docker': + cw = DockerFactsWorker(module) + else: + cw = PodmanFactsWorker(module) - module.exit_json(**results) + result = bool(getattr(cw, module.params.get('action'))()) + module.exit_json(result=result, **cw.results) + except Exception: + module.fail_json(changed=True, msg=repr(format_exc()), + **getattr(cw, 'result', {})) if __name__ == "__main__": diff --git a/ansible/roles/aodh/tasks/precheck.yml b/ansible/roles/aodh/tasks/precheck.yml index 075ffa4d40..8351e43594 100644 --- a/ansible/roles/aodh/tasks/precheck.yml +++ b/ansible/roles/aodh/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - aodh_api diff --git a/ansible/roles/barbican/tasks/precheck.yml b/ansible/roles/barbican/tasks/precheck.yml index 909b7b3838..b33d069879 100644 --- a/ansible/roles/barbican/tasks/precheck.yml +++ b/ansible/roles/barbican/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - barbican_api diff --git a/ansible/roles/bifrost/tasks/stop.yml b/ansible/roles/bifrost/tasks/stop.yml index 7609ad123f..1c961d2432 100644 --- a/ansible/roles/bifrost/tasks/stop.yml +++ b/ansible/roles/bifrost/tasks/stop.yml @@ -3,6 +3,7 @@ - name: Check if bifrost_deploy container is running become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - bifrost_deploy diff --git a/ansible/roles/blazar/tasks/precheck.yml b/ansible/roles/blazar/tasks/precheck.yml index 02408a2f7e..c77486e814 100644 --- a/ansible/roles/blazar/tasks/precheck.yml +++ b/ansible/roles/blazar/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - blazar_api diff --git a/ansible/roles/cinder/tasks/precheck.yml b/ansible/roles/cinder/tasks/precheck.yml index 41c55673ab..9a14b8c1d7 100644 --- a/ansible/roles/cinder/tasks/precheck.yml +++ b/ansible/roles/cinder/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - cinder_api diff --git a/ansible/roles/cloudkitty/tasks/precheck.yml b/ansible/roles/cloudkitty/tasks/precheck.yml index f5e2a56f84..0892ba8e6e 100644 --- a/ansible/roles/cloudkitty/tasks/precheck.yml +++ b/ansible/roles/cloudkitty/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - cloudkitty_api diff --git a/ansible/roles/cyborg/tasks/precheck.yml b/ansible/roles/cyborg/tasks/precheck.yml index 819913a21c..6211c5e240 100644 --- a/ansible/roles/cyborg/tasks/precheck.yml +++ b/ansible/roles/cyborg/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - cyborg_api diff --git a/ansible/roles/designate/tasks/precheck.yml b/ansible/roles/designate/tasks/precheck.yml index d1b023c207..80337a3a1a 100644 --- a/ansible/roles/designate/tasks/precheck.yml +++ b/ansible/roles/designate/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - designate_api diff --git a/ansible/roles/etcd/tasks/precheck.yml b/ansible/roles/etcd/tasks/precheck.yml index 0a1cc78f41..131f4132b2 100644 --- a/ansible/roles/etcd/tasks/precheck.yml +++ b/ansible/roles/etcd/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - etcd diff --git a/ansible/roles/glance/tasks/precheck.yml b/ansible/roles/glance/tasks/precheck.yml index 775bd58a66..09cff1e9ea 100644 --- a/ansible/roles/glance/tasks/precheck.yml +++ b/ansible/roles/glance/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: "{{ glance_services.values() | map(attribute='container_name') | list }}" check_mode: false diff --git a/ansible/roles/gnocchi/tasks/precheck.yml b/ansible/roles/gnocchi/tasks/precheck.yml index 95d41e8ef8..f0ecf557c4 100644 --- a/ansible/roles/gnocchi/tasks/precheck.yml +++ b/ansible/roles/gnocchi/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - gnocchi_api diff --git a/ansible/roles/grafana/tasks/precheck.yml b/ansible/roles/grafana/tasks/precheck.yml index 78f1b048f6..a95701c490 100644 --- a/ansible/roles/grafana/tasks/precheck.yml +++ b/ansible/roles/grafana/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - grafana diff --git a/ansible/roles/hacluster/tasks/precheck.yml b/ansible/roles/hacluster/tasks/precheck.yml index c77f7c78b2..80391d046d 100644 --- a/ansible/roles/hacluster/tasks/precheck.yml +++ b/ansible/roles/hacluster/tasks/precheck.yml @@ -2,6 +2,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - hacluster_pacemaker_remote diff --git a/ansible/roles/heat/tasks/precheck.yml b/ansible/roles/heat/tasks/precheck.yml index 48b4059e58..d10ba4ae7c 100644 --- a/ansible/roles/heat/tasks/precheck.yml +++ b/ansible/roles/heat/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - heat_api diff --git a/ansible/roles/horizon/tasks/precheck.yml b/ansible/roles/horizon/tasks/precheck.yml index 97b8b7ddf3..29fe38a968 100644 --- a/ansible/roles/horizon/tasks/precheck.yml +++ b/ansible/roles/horizon/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - horizon diff --git a/ansible/roles/influxdb/tasks/precheck.yml b/ansible/roles/influxdb/tasks/precheck.yml index b754b2af34..4629ccc764 100644 --- a/ansible/roles/influxdb/tasks/precheck.yml +++ b/ansible/roles/influxdb/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - influxdb diff --git a/ansible/roles/ironic/tasks/precheck.yml b/ansible/roles/ironic/tasks/precheck.yml index 19190b5b28..b2f2a83d9b 100644 --- a/ansible/roles/ironic/tasks/precheck.yml +++ b/ansible/roles/ironic/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - ironic_api diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index 4d36bc5dfc..bd72b1da43 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - iscsid diff --git a/ansible/roles/keystone/tasks/bootstrap_service.yml b/ansible/roles/keystone/tasks/bootstrap_service.yml index 3b8be515c7..daefcfaebc 100644 --- a/ansible/roles/keystone/tasks/bootstrap_service.yml +++ b/ansible/roles/keystone/tasks/bootstrap_service.yml @@ -2,6 +2,7 @@ - name: Checking for any running keystone_fernet containers become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - keystone_fernet diff --git a/ansible/roles/keystone/tasks/precheck.yml b/ansible/roles/keystone/tasks/precheck.yml index 0513f7411e..3a84f86770 100644 --- a/ansible/roles/keystone/tasks/precheck.yml +++ b/ansible/roles/keystone/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - keystone diff --git a/ansible/roles/kuryr/tasks/precheck.yml b/ansible/roles/kuryr/tasks/precheck.yml index 078d1dd9e8..31acfd6c08 100644 --- a/ansible/roles/kuryr/tasks/precheck.yml +++ b/ansible/roles/kuryr/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - kuryr diff --git a/ansible/roles/letsencrypt/tasks/precheck.yml b/ansible/roles/letsencrypt/tasks/precheck.yml index ce8dac2f1f..b1462dbadc 100644 --- a/ansible/roles/letsencrypt/tasks/precheck.yml +++ b/ansible/roles/letsencrypt/tasks/precheck.yml @@ -2,6 +2,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - letsencrypt_webserver diff --git a/ansible/roles/loadbalancer/tasks/precheck.yml b/ansible/roles/loadbalancer/tasks/precheck.yml index 196dff8b0c..b5ff808958 100644 --- a/ansible/roles/loadbalancer/tasks/precheck.yml +++ b/ansible/roles/loadbalancer/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - haproxy diff --git a/ansible/roles/magnum/tasks/precheck.yml b/ansible/roles/magnum/tasks/precheck.yml index d3eb58ceba..d9e83fb00f 100644 --- a/ansible/roles/magnum/tasks/precheck.yml +++ b/ansible/roles/magnum/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - magnum_api diff --git a/ansible/roles/manila/tasks/precheck.yml b/ansible/roles/manila/tasks/precheck.yml index 7f47557ba8..630b288628 100644 --- a/ansible/roles/manila/tasks/precheck.yml +++ b/ansible/roles/manila/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - manila_api diff --git a/ansible/roles/mariadb/tasks/precheck.yml b/ansible/roles/mariadb/tasks/precheck.yml index f852456477..d6337e7de2 100644 --- a/ansible/roles/mariadb/tasks/precheck.yml +++ b/ansible/roles/mariadb/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - mariadb diff --git a/ansible/roles/masakari/tasks/precheck.yml b/ansible/roles/masakari/tasks/precheck.yml index c77403bfba..71d9cca21a 100644 --- a/ansible/roles/masakari/tasks/precheck.yml +++ b/ansible/roles/masakari/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - masakari_api diff --git a/ansible/roles/memcached/tasks/precheck.yml b/ansible/roles/memcached/tasks/precheck.yml index 0601c6d733..c5ab94ce02 100644 --- a/ansible/roles/memcached/tasks/precheck.yml +++ b/ansible/roles/memcached/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - memcached diff --git a/ansible/roles/mistral/tasks/precheck.yml b/ansible/roles/mistral/tasks/precheck.yml index 19264fc578..307b4376eb 100644 --- a/ansible/roles/mistral/tasks/precheck.yml +++ b/ansible/roles/mistral/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - mistral_api diff --git a/ansible/roles/neutron/handlers/main.yml b/ansible/roles/neutron/handlers/main.yml index 6d6a547f0f..50ab08c06c 100644 --- a/ansible/roles/neutron/handlers/main.yml +++ b/ansible/roles/neutron/handlers/main.yml @@ -90,6 +90,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - neutron_l3_agent diff --git a/ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml b/ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml index 931a2c5f41..8fa64093fc 100644 --- a/ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml +++ b/ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml @@ -2,6 +2,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - neutron_openvswitch_agent diff --git a/ansible/roles/neutron/tasks/precheck.yml b/ansible/roles/neutron/tasks/precheck.yml index 8051a53991..74f1eabc2b 100644 --- a/ansible/roles/neutron/tasks/precheck.yml +++ b/ansible/roles/neutron/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - neutron_server diff --git a/ansible/roles/nova-cell/tasks/libvirt-cleanup.yml b/ansible/roles/nova-cell/tasks/libvirt-cleanup.yml index 95fb670b53..2a61585e81 100644 --- a/ansible/roles/nova-cell/tasks/libvirt-cleanup.yml +++ b/ansible/roles/nova-cell/tasks/libvirt-cleanup.yml @@ -9,6 +9,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - nova_libvirt diff --git a/ansible/roles/nova-cell/tasks/precheck.yml b/ansible/roles/nova-cell/tasks/precheck.yml index efa19fdd8b..410debff00 100644 --- a/ansible/roles/nova-cell/tasks/precheck.yml +++ b/ansible/roles/nova-cell/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - nova_libvirt diff --git a/ansible/roles/nova/tasks/precheck.yml b/ansible/roles/nova/tasks/precheck.yml index c1d816eb0b..ee68197c37 100644 --- a/ansible/roles/nova/tasks/precheck.yml +++ b/ansible/roles/nova/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - nova_api diff --git a/ansible/roles/octavia/tasks/precheck.yml b/ansible/roles/octavia/tasks/precheck.yml index c05be80732..be672853e7 100644 --- a/ansible/roles/octavia/tasks/precheck.yml +++ b/ansible/roles/octavia/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - octavia_api diff --git a/ansible/roles/opensearch/tasks/precheck.yml b/ansible/roles/opensearch/tasks/precheck.yml index 835316f09e..47e2dff163 100644 --- a/ansible/roles/opensearch/tasks/precheck.yml +++ b/ansible/roles/opensearch/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - opensearch diff --git a/ansible/roles/openvswitch/tasks/precheck.yml b/ansible/roles/openvswitch/tasks/precheck.yml index 8cc4aec449..f2b152e970 100644 --- a/ansible/roles/openvswitch/tasks/precheck.yml +++ b/ansible/roles/openvswitch/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - openvswitch_db diff --git a/ansible/roles/ovn-db/tasks/precheck.yml b/ansible/roles/ovn-db/tasks/precheck.yml index 341ddcf288..e06baddc56 100644 --- a/ansible/roles/ovn-db/tasks/precheck.yml +++ b/ansible/roles/ovn-db/tasks/precheck.yml @@ -2,6 +2,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - ovn_nb_db diff --git a/ansible/roles/placement/tasks/precheck.yml b/ansible/roles/placement/tasks/precheck.yml index 47cfd750f9..02ff052fb4 100644 --- a/ansible/roles/placement/tasks/precheck.yml +++ b/ansible/roles/placement/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - placement_api diff --git a/ansible/roles/prometheus/tasks/precheck.yml b/ansible/roles/prometheus/tasks/precheck.yml index a9487ae970..4aea7ed218 100644 --- a/ansible/roles/prometheus/tasks/precheck.yml +++ b/ansible/roles/prometheus/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - prometheus_server diff --git a/ansible/roles/rabbitmq/tasks/precheck.yml b/ansible/roles/rabbitmq/tasks/precheck.yml index 156afd76f7..1837c1c1fe 100644 --- a/ansible/roles/rabbitmq/tasks/precheck.yml +++ b/ansible/roles/rabbitmq/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - rabbitmq diff --git a/ansible/roles/rabbitmq/tasks/remove-ha-all-policy.yml b/ansible/roles/rabbitmq/tasks/remove-ha-all-policy.yml index a44b037cc2..574069cb77 100644 --- a/ansible/roles/rabbitmq/tasks/remove-ha-all-policy.yml +++ b/ansible/roles/rabbitmq/tasks/remove-ha-all-policy.yml @@ -3,6 +3,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - "{{ service.container_name }}" diff --git a/ansible/roles/rabbitmq/tasks/restart_services.yml b/ansible/roles/rabbitmq/tasks/restart_services.yml index 33a08dcd38..289015e1c6 100644 --- a/ansible/roles/rabbitmq/tasks/restart_services.yml +++ b/ansible/roles/rabbitmq/tasks/restart_services.yml @@ -2,6 +2,7 @@ - name: Get info on RabbitMQ container become: True kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: "rabbitmq" register: container_info diff --git a/ansible/roles/redis/tasks/precheck.yml b/ansible/roles/redis/tasks/precheck.yml index 73c218be5f..a9225a0807 100644 --- a/ansible/roles/redis/tasks/precheck.yml +++ b/ansible/roles/redis/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - redis diff --git a/ansible/roles/service-config-validate/tasks/validate.yml b/ansible/roles/service-config-validate/tasks/validate.yml index a327277fe0..025f55b8bd 100644 --- a/ansible/roles/service-config-validate/tasks/validate.yml +++ b/ansible/roles/service-config-validate/tasks/validate.yml @@ -2,6 +2,7 @@ - name: "{{ project_name }} : {{ service.container_name }} | Get info on container" become: True kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - "{{ service.container_name }}" diff --git a/ansible/roles/skyline/tasks/precheck.yml b/ansible/roles/skyline/tasks/precheck.yml index 104797dc89..0a081b2042 100644 --- a/ansible/roles/skyline/tasks/precheck.yml +++ b/ansible/roles/skyline/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - skyline_apiserver diff --git a/ansible/roles/swift/tasks/precheck.yml b/ansible/roles/swift/tasks/precheck.yml index c81c4de0e4..423915afd9 100644 --- a/ansible/roles/swift/tasks/precheck.yml +++ b/ansible/roles/swift/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - swift_account_server diff --git a/ansible/roles/tacker/tasks/precheck.yml b/ansible/roles/tacker/tasks/precheck.yml index 5dce1aa66f..5bdb592b4f 100644 --- a/ansible/roles/tacker/tasks/precheck.yml +++ b/ansible/roles/tacker/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - tacker_server diff --git a/ansible/roles/trove/tasks/precheck.yml b/ansible/roles/trove/tasks/precheck.yml index 5502edaaa6..60aa0a4e73 100644 --- a/ansible/roles/trove/tasks/precheck.yml +++ b/ansible/roles/trove/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - trove_api diff --git a/ansible/roles/venus/tasks/precheck.yml b/ansible/roles/venus/tasks/precheck.yml index 1a57aed326..b3debf8fd9 100644 --- a/ansible/roles/venus/tasks/precheck.yml +++ b/ansible/roles/venus/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - venus_api diff --git a/ansible/roles/watcher/tasks/precheck.yml b/ansible/roles/watcher/tasks/precheck.yml index f75833aeb3..3828d011ef 100644 --- a/ansible/roles/watcher/tasks/precheck.yml +++ b/ansible/roles/watcher/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - watcher_api diff --git a/ansible/roles/zun/tasks/precheck.yml b/ansible/roles/zun/tasks/precheck.yml index 5b9f64d06b..244f483b60 100644 --- a/ansible/roles/zun/tasks/precheck.yml +++ b/ansible/roles/zun/tasks/precheck.yml @@ -8,6 +8,7 @@ - name: Get container facts become: true kolla_container_facts: + action: get_containers container_engine: "{{ kolla_container_engine }}" name: - zun_api