diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 7016426704..648537ad3e 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -86,6 +86,10 @@ database_port: "3306" database_connection_recycle_time: 10 database_max_pool_size: 1 +#################### +# Container engine options +#################### +kolla_container_engine: "docker" #################### # Docker options diff --git a/ansible/roles/bifrost/tasks/bootstrap.yml b/ansible/roles/bifrost/tasks/bootstrap.yml index 535c1b4e05..90baf486f8 100644 --- a/ansible/roles/bifrost/tasks/bootstrap.yml +++ b/ansible/roles/bifrost/tasks/bootstrap.yml @@ -5,7 +5,7 @@ is_debian: "{{ kolla_base_distro in ['debian', 'ubuntu'] }}" become: true command: > - docker exec bifrost_deploy + {{ kolla_container_engine }} exec bifrost_deploy bash -c 'mkdir -p /var/log/kolla/ironic && chown ironic:ironic /var/log/kolla/ironic && mkdir -p /var/log/kolla/ironic-inspector && @@ -16,7 +16,7 @@ - name: Bootstrap bifrost (this may take several minutes) become: true command: > - docker exec bifrost_deploy + {{ kolla_container_engine }} exec bifrost_deploy bash -c 'ansible-playbook {{ bifrost_deploy_verbosity }} -i /bifrost/playbooks/inventory/target @@ -26,7 +26,7 @@ - name: Installing ssh keys become: true command: > - docker exec bifrost_deploy + {{ kolla_container_engine }} exec bifrost_deploy bash -c 'mkdir /root/.ssh ; mkdir /home/ironic/.ssh; cp -f /etc/bifrost/id_rsa /root/.ssh/id_rsa && cp -f /etc/bifrost/id_rsa.pub /root/.ssh/id_rsa.pub && diff --git a/ansible/roles/bifrost/tasks/deploy-servers.yml b/ansible/roles/bifrost/tasks/deploy-servers.yml index 17a2c24f73..7e71973393 100644 --- a/ansible/roles/bifrost/tasks/deploy-servers.yml +++ b/ansible/roles/bifrost/tasks/deploy-servers.yml @@ -2,7 +2,7 @@ - name: Enrolling physical servers with ironic become: true command: > - docker exec bifrost_deploy + {{ kolla_container_engine }} exec bifrost_deploy bash -c 'export OS_CLOUD=bifrost && export BIFROST_INVENTORY_SOURCE=/etc/bifrost/servers.yml && ansible-playbook {{ bifrost_deploy_verbosity }}} @@ -12,7 +12,7 @@ - name: Deploy physical servers with ironic become: true command: > - docker exec bifrost_deploy + {{ kolla_container_engine }} exec bifrost_deploy bash -c 'export OS_CLOUD=bifrost && export BIFROST_INVENTORY_SOURCE=/etc/bifrost/servers.yml && ansible-playbook {{ bifrost_deploy_verbosity }} diff --git a/ansible/roles/bifrost/tasks/reconfigure.yml b/ansible/roles/bifrost/tasks/reconfigure.yml index c8f91cd87b..d19a455fc4 100644 --- a/ansible/roles/bifrost/tasks/reconfigure.yml +++ b/ansible/roles/bifrost/tasks/reconfigure.yml @@ -14,7 +14,7 @@ - name: Check the configs become: true - command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check + command: "{{ kolla_container_engine }} exec {{ item.name }} /usr/local/bin/kolla_set_configs --check" changed_when: false failed_when: false register: check_results diff --git a/ansible/roles/bifrost/tasks/stop.yml b/ansible/roles/bifrost/tasks/stop.yml index af315f0909..8220dbf580 100644 --- a/ansible/roles/bifrost/tasks/stop.yml +++ b/ansible/roles/bifrost/tasks/stop.yml @@ -12,7 +12,7 @@ # order. - name: Stop services gracefully become: true - command: docker exec bifrost_deploy systemctl stop {{ item }}.service + command: "{{ kolla_container_engine }} exec bifrost_deploy systemctl stop {{ item }}.service" with_items: - ironic - ironic-inspector diff --git a/ansible/roles/common/handlers/main.yml b/ansible/roles/common/handlers/main.yml index 2b31f969f0..aad204f7fb 100644 --- a/ansible/roles/common/handlers/main.yml +++ b/ansible/roles/common/handlers/main.yml @@ -36,7 +36,7 @@ - name: Initializing toolbox container using normal user become: true - command: docker exec -t "{{ common_services['kolla-toolbox']['container_name'] }}" ansible --version + command: "{{ kolla_container_engine }} exec -t {{ common_services['kolla-toolbox']['container_name'] }} ansible --version" changed_when: false - name: Restart cron container diff --git a/ansible/roles/designate/tasks/update_pools.yml b/ansible/roles/designate/tasks/update_pools.yml index d89c6841c3..0ac62443a2 100644 --- a/ansible/roles/designate/tasks/update_pools.yml +++ b/ansible/roles/designate/tasks/update_pools.yml @@ -1,6 +1,6 @@ --- - name: Update DNS pools become: true - command: docker exec -t designate_worker designate-manage pool update --file /etc/designate/pools.yaml + command: "{{ kolla_container_engine }} exec -t designate_worker designate-manage pool update --file /etc/designate/pools.yaml" run_once: True delegate_to: "{{ groups['designate-worker'][0] }}" diff --git a/ansible/roles/hacluster/tasks/bootstrap_service.yml b/ansible/roles/hacluster/tasks/bootstrap_service.yml index be4f057ae8..8d503f6740 100644 --- a/ansible/roles/hacluster/tasks/bootstrap_service.yml +++ b/ansible/roles/hacluster/tasks/bootstrap_service.yml @@ -2,7 +2,7 @@ - name: Ensure stonith is disabled vars: service: "{{ hacluster_services['hacluster-pacemaker'] }}" - command: docker exec {{ service.container_name }} crm_attribute --type crm_config --name stonith-enabled --update false + command: "{{ kolla_container_engine }} exec {{ service.container_name }} crm_attribute --type crm_config --name stonith-enabled --update false" run_once: true become: true delegate_to: "{{ groups[service.group][0] }}" @@ -12,7 +12,7 @@ pacemaker_service: "{{ hacluster_services['hacluster-pacemaker'] }}" pacemaker_remote_service: "{{ hacluster_services['hacluster-pacemaker-remote'] }}" shell: > - docker exec {{ pacemaker_service.container_name }} + {{ kolla_container_engine }} exec {{ pacemaker_service.container_name }} cibadmin --modify --scope resources -X ' diff --git a/ansible/roles/ironic/tasks/upgrade.yml b/ansible/roles/ironic/tasks/upgrade.yml index a16115fed9..a88d565ae4 100644 --- a/ansible/roles/ironic/tasks/upgrade.yml +++ b/ansible/roles/ironic/tasks/upgrade.yml @@ -2,7 +2,7 @@ - name: Wait for Ironic nodes not to wait become: true command: > - docker exec kolla_toolbox openstack + {{ kolla_container_engine }} exec kolla_toolbox openstack --os-interface {{ openstack_interface }} --os-auth-url {{ openstack_auth.auth_url }} --os-username {{ openstack_auth.username }} diff --git a/ansible/roles/keystone/tasks/distribute_fernet.yml b/ansible/roles/keystone/tasks/distribute_fernet.yml index ce7414b643..91a2305ada 100644 --- a/ansible/roles/keystone/tasks/distribute_fernet.yml +++ b/ansible/roles/keystone/tasks/distribute_fernet.yml @@ -11,7 +11,7 @@ - name: Run key distribution become: true - command: docker exec -t "{{ keystone_services['keystone-fernet']['container_name'] }}" /usr/bin/fernet-push.sh + command: "{{ kolla_container_engine }} exec -t {{ keystone_services['keystone-fernet']['container_name'] }} /usr/bin/fernet-push.sh" run_once: True delegate_to: >- {% if groups['keystone_fernet_running'] is defined -%} diff --git a/ansible/roles/keystone/tasks/register.yml b/ansible/roles/keystone/tasks/register.yml index 90b0457795..5666b87395 100644 --- a/ansible/roles/keystone/tasks/register.yml +++ b/ansible/roles/keystone/tasks/register.yml @@ -2,7 +2,7 @@ - name: Creating admin project, user, role, service, and endpoint become: true command: > - docker exec keystone kolla_keystone_bootstrap + {{ kolla_container_engine }} exec keystone kolla_keystone_bootstrap {{ openstack_auth.username }} {{ openstack_auth.password }} {{ keystone_admin_project }} admin {{ keystone_internal_url }} {{ keystone_public_url }} {{ item }} register: keystone_bootstrap diff --git a/ansible/roles/keystone/tasks/register_identity_providers.yml b/ansible/roles/keystone/tasks/register_identity_providers.yml index 9e1b74f19d..45d8540585 100644 --- a/ansible/roles/keystone/tasks/register_identity_providers.yml +++ b/ansible/roles/keystone/tasks/register_identity_providers.yml @@ -1,7 +1,7 @@ --- - name: List configured attribute mappings (that can be used by IdPs) command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -22,7 +22,7 @@ - name: Remove unmanaged attribute mappings command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -57,7 +57,7 @@ - name: Register attribute mappings in OpenStack become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -78,7 +78,7 @@ - name: Update existing attribute mappings in OpenStack become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -99,7 +99,7 @@ - name: List configured IdPs become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -120,7 +120,7 @@ - name: Remove unmanaged identity providers become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -140,7 +140,7 @@ - name: Register Identity Providers in OpenStack become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -163,7 +163,7 @@ - name: Update Identity Providers in OpenStack according to Kolla-Ansible configurations become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -185,7 +185,7 @@ - name: Configure attribute mappings for each Identity Provider. (We expect the mappings to be configured by the operator) become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} @@ -207,7 +207,7 @@ - name: Update attribute mappings for each Identity Provider. (We expect the mappings to be configured by the operator). become: true command: > - docker exec -t keystone openstack + {{ kolla_container_engine }} exec -t keystone openstack --os-auth-url={{ openstack_auth.auth_url }} --os-password={{ openstack_auth.password }} --os-username={{ openstack_auth.username }} diff --git a/ansible/roles/loadbalancer/tasks/precheck.yml b/ansible/roles/loadbalancer/tasks/precheck.yml index d0218c53cf..77639ce1eb 100644 --- a/ansible/roles/loadbalancer/tasks/precheck.yml +++ b/ansible/roles/loadbalancer/tasks/precheck.yml @@ -194,7 +194,7 @@ - name: Getting haproxy stat become: true - shell: echo "show stat" | docker exec -i haproxy socat unix-connect:/var/lib/kolla/haproxy/haproxy.sock stdio # noqa risky-shell-pipe + shell: echo "show stat" | {{ kolla_container_engine }} exec -i haproxy socat unix-connect:/var/lib/kolla/haproxy/haproxy.sock stdio # noqa risky-shell-pipe register: haproxy_stat_shell changed_when: false when: container_facts['haproxy'] is defined diff --git a/ansible/roles/mariadb/handlers/main.yml b/ansible/roles/mariadb/handlers/main.yml index fb76c96431..1c76fc48ff 100644 --- a/ansible/roles/mariadb/handlers/main.yml +++ b/ansible/roles/mariadb/handlers/main.yml @@ -36,7 +36,7 @@ - name: Wait for first MariaDB service to sync WSREP become: true command: >- - docker exec {{ mariadb_service.container_name }} + {{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_local_state_comment"' diff --git a/ansible/roles/mariadb/tasks/check.yml b/ansible/roles/mariadb/tasks/check.yml index 212e2e9a10..db5c254697 100644 --- a/ansible/roles/mariadb/tasks/check.yml +++ b/ansible/roles/mariadb/tasks/check.yml @@ -5,7 +5,7 @@ - name: Wait for MariaDB service to be ready through VIP become: true command: > - docker exec {{ mariadb_service.container_name }} + {{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -h {{ database_address }} -P {{ database_port }} -u {{ mariadb_shard_database_user }} -p{{ database_password }} -e 'show databases;' register: result diff --git a/ansible/roles/mariadb/tasks/lookup_cluster.yml b/ansible/roles/mariadb/tasks/lookup_cluster.yml index aa355adcfd..39172abc4c 100644 --- a/ansible/roles/mariadb/tasks/lookup_cluster.yml +++ b/ansible/roles/mariadb/tasks/lookup_cluster.yml @@ -45,7 +45,7 @@ - name: Check MariaDB service WSREP sync status become: true command: >- - docker exec {{ mariadb_service.container_name }} + {{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_local_state_comment"' diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml index d0d86aef43..a2a47a4087 100644 --- a/ansible/roles/mariadb/tasks/recover_cluster.yml +++ b/ansible/roles/mariadb/tasks/recover_cluster.yml @@ -142,7 +142,7 @@ - name: Set first MariaDB container as primary become: true - shell: "docker exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} -e \"SET GLOBAL wsrep_provider_options='pc.bootstrap=yes';\"" + shell: "{{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} -e \"SET GLOBAL wsrep_provider_options='pc.bootstrap=yes';\"" no_log: True when: - bootstrap_host is defined @@ -151,7 +151,7 @@ - name: Wait for MariaDB to become operational become: true command: >- - docker exec {{ mariadb_service.container_name }} + {{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"' diff --git a/ansible/roles/mariadb/tasks/restart_services.yml b/ansible/roles/mariadb/tasks/restart_services.yml index f4970fd1de..b80c909f3e 100644 --- a/ansible/roles/mariadb/tasks/restart_services.yml +++ b/ansible/roles/mariadb/tasks/restart_services.yml @@ -30,7 +30,7 @@ - name: Wait for MariaDB service to sync WSREP become: true command: >- - docker exec {{ mariadb_service.container_name }} + {{ kolla_container_engine }} exec {{ mariadb_service.container_name }} mysql -uroot -p{{ database_password }} --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_local_state_comment"' diff --git a/ansible/roles/monasca/tasks/bootstrap.yml b/ansible/roles/monasca/tasks/bootstrap.yml index 1536bcc1c3..402c5b0201 100644 --- a/ansible/roles/monasca/tasks/bootstrap.yml +++ b/ansible/roles/monasca/tasks/bootstrap.yml @@ -44,7 +44,7 @@ # [1] https://github.com/influxdata/influxdb-python#influxdb-pre-v110-users - name: List influxdb databases become: true - command: "docker exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute 'show databases'" + command: "{{ kolla_container_engine }} exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute 'show databases'" run_once: True delegate_to: "{{ groups['influxdb'][0] }}" register: monasca_influxdb_database @@ -53,7 +53,7 @@ - name: Creating monasca influxdb database become: true command: > - docker exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute + {{ kolla_container_engine }} exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute 'CREATE DATABASE {{ monasca_influxdb_name }} WITH DURATION {{ monasca_influxdb_retention_policy.duration }} REPLICATION {{ monasca_influxdb_retention_policy.replication_count }} NAME {{ monasca_influxdb_retention_policy.name }}' run_once: True @@ -68,7 +68,7 @@ - name: List monasca kafka topics become: true command: > - docker exec kafka /opt/kafka/bin/kafka-topics.sh + {{ kolla_container_engine }} exec kafka /opt/kafka/bin/kafka-topics.sh --zookeeper localhost --list register: kafka_topics @@ -78,7 +78,7 @@ - name: Create monasca kafka topics if they don't exist become: true command: > - docker exec kafka /opt/kafka/bin/kafka-topics.sh + {{ kolla_container_engine }} exec kafka /opt/kafka/bin/kafka-topics.sh --create --topic {{ item.name }} --partitions {{ item.partitions }} @@ -94,7 +94,7 @@ - name: Remove monasca kafka topics for disabled services become: true command: > - docker exec kafka /opt/kafka/bin/kafka-topics.sh + {{ kolla_container_engine }} exec kafka /opt/kafka/bin/kafka-topics.sh --delete --topic "{{ item.name }}" --zookeeper localhost diff --git a/ansible/roles/murano/tasks/import_library_packages.yml b/ansible/roles/murano/tasks/import_library_packages.yml index ec9bdd9d88..ba8ce43e3b 100644 --- a/ansible/roles/murano/tasks/import_library_packages.yml +++ b/ansible/roles/murano/tasks/import_library_packages.yml @@ -15,7 +15,7 @@ - name: Checking if Murano core and applications library packages exist become: true command: > - docker exec murano_api murano + {{ kolla_container_engine }} exec murano_api murano --os-username {{ openstack_auth.username }} --os-password {{ openstack_auth.password }} --os-system-scope {{ openstack_auth.system_scope }} @@ -31,7 +31,7 @@ - name: Importing Murano core library package become: true command: > - docker exec murano_api murano + {{ kolla_container_engine }} exec murano_api murano --os-username {{ openstack_auth.username }} --os-password {{ openstack_auth.password }} --os-system-scope {{ openstack_auth.system_scope }} @@ -47,7 +47,7 @@ - name: Importing Murano applications library package become: true command: > - docker exec murano_api murano + {{ kolla_container_engine }} exec murano_api murano --os-username {{ openstack_auth.username }} --os-password {{ openstack_auth.password }} --os-system-scope {{ openstack_auth.system_scope }} diff --git a/ansible/roles/neutron/tasks/rolling_upgrade.yml b/ansible/roles/neutron/tasks/rolling_upgrade.yml index 987e43851a..20c523bbde 100644 --- a/ansible/roles/neutron/tasks/rolling_upgrade.yml +++ b/ansible/roles/neutron/tasks/rolling_upgrade.yml @@ -37,7 +37,7 @@ - name: Checking neutron pending contract scripts become: true - command: "docker exec -t neutron_server neutron-db-manage --subproject {{ item }} has_offline_migrations" + command: "{{ kolla_container_engine }} exec -t neutron_server neutron-db-manage --subproject {{ item }} has_offline_migrations" register: neutron_check_contract_db_stdout ignore_errors: yes with_items: "{{ neutron_rolling_upgrade_services }}" diff --git a/ansible/roles/nova-cell/handlers/main.yml b/ansible/roles/nova-cell/handlers/main.yml index 403689def2..132cc04669 100644 --- a/ansible/roles/nova-cell/handlers/main.yml +++ b/ansible/roles/nova-cell/handlers/main.yml @@ -122,7 +122,7 @@ cmd: > set -o pipefail && echo {{ libvirt_sasl_password }} | - docker exec -i nova_libvirt + {{ kolla_container_engine }} exec -i nova_libvirt saslpasswd2 -c -p -a libvirt {{ libvirt_sasl_authname }} executable: /bin/bash changed_when: true diff --git a/ansible/roles/nova-cell/tasks/discover_computes.yml b/ansible/roles/nova-cell/tasks/discover_computes.yml index 49d38b6c37..559be6aaa1 100644 --- a/ansible/roles/nova-cell/tasks/discover_computes.yml +++ b/ansible/roles/nova-cell/tasks/discover_computes.yml @@ -14,7 +14,7 @@ - name: Discover nova hosts become: true command: > - docker exec nova_conductor nova-manage cell_v2 discover_hosts --by-service --cell_uuid {{ nova_cell_settings.cell_uuid }} + {{ kolla_container_engine }} exec nova_conductor nova-manage cell_v2 discover_hosts --by-service --cell_uuid {{ nova_cell_settings.cell_uuid }} changed_when: False # Delegate to a cell conductor. diff --git a/ansible/roles/nova-cell/tasks/wait_discover_computes.yml b/ansible/roles/nova-cell/tasks/wait_discover_computes.yml index 89587dab2c..1729eed390 100644 --- a/ansible/roles/nova-cell/tasks/wait_discover_computes.yml +++ b/ansible/roles/nova-cell/tasks/wait_discover_computes.yml @@ -8,7 +8,7 @@ - name: Waiting for nova-compute services to register themselves become: true command: > - docker exec kolla_toolbox openstack + {{ kolla_container_engine }} exec kolla_toolbox openstack --os-interface {{ openstack_interface }} --os-auth-url {{ openstack_auth.auth_url }} --os-username {{ openstack_auth.username }} diff --git a/ansible/roles/nova/tasks/refresh_scheduler_cell_cache.yml b/ansible/roles/nova/tasks/refresh_scheduler_cell_cache.yml index d2e61578f2..d4760c0b48 100644 --- a/ansible/roles/nova/tasks/refresh_scheduler_cell_cache.yml +++ b/ansible/roles/nova/tasks/refresh_scheduler_cell_cache.yml @@ -7,6 +7,6 @@ # Docker bug (https://github.com/moby/moby/issues/11065), this might cause the # container to be stopped if we restart Docker or reboot the server as we # use the 'unless-stopped' restart policy by default. - shell: "kill -HUP `docker inspect -f '{% raw %}{{ .State.Pid }}{% endraw %}' nova_scheduler`" + shell: "kill -HUP `{{ kolla_container_engine }} inspect -f '{% raw %}{{ .State.Pid }}{% endraw %}' nova_scheduler`" when: - inventory_hostname in groups['nova-scheduler'] diff --git a/ansible/roles/nova/tasks/upgrade.yml b/ansible/roles/nova/tasks/upgrade.yml index 25230266a6..d6f3f70c42 100644 --- a/ansible/roles/nova/tasks/upgrade.yml +++ b/ansible/roles/nova/tasks/upgrade.yml @@ -1,7 +1,7 @@ --- - name: Check nova upgrade status become: true - command: docker exec -t nova_api nova-status upgrade check + command: "{{ kolla_container_engine }} exec -t nova_api nova-status upgrade check" register: nova_upgrade_check_stdout when: inventory_hostname == groups['nova-api'][0] failed_when: false diff --git a/ansible/roles/octavia/tasks/hm-interface.yml b/ansible/roles/octavia/tasks/hm-interface.yml index 87ff409a91..4ebf07aaf3 100644 --- a/ansible/roles/octavia/tasks/hm-interface.yml +++ b/ansible/roles/octavia/tasks/hm-interface.yml @@ -23,7 +23,7 @@ vars: port_id: "{{ port_info.id }}" command: > - docker exec kolla_toolbox openstack + {{ kolla_container_engine }} exec kolla_toolbox openstack --os-interface {{ openstack_interface }} --os-auth-url {{ octavia_user_auth.auth_url }} --os-identity-api-version 3 @@ -43,7 +43,7 @@ port_id: "{{ port_info.id }}" become: True command: > - docker exec openvswitch_vswitchd ovs-vsctl --may-exist \ + {{ kolla_container_engine }} exec openvswitch_vswitchd ovs-vsctl --may-exist \ add-port br-int {{ octavia_network_interface }} \ -- set Interface {{ octavia_network_interface }} type=internal \ -- set Interface {{ octavia_network_interface }} external-ids:iface-status=active \ diff --git a/ansible/roles/openvswitch/handlers/main.yml b/ansible/roles/openvswitch/handlers/main.yml index 3fbf322a31..a97ea7d59d 100644 --- a/ansible/roles/openvswitch/handlers/main.yml +++ b/ansible/roles/openvswitch/handlers/main.yml @@ -19,7 +19,7 @@ - name: Waiting for openvswitch_db service to be ready become: true - command: docker exec openvswitch_db ovs-vsctl --no-wait show + command: "{{ kolla_container_engine }} exec openvswitch_db ovs-vsctl --no-wait show" register: check_result until: check_result is success changed_when: False diff --git a/ansible/roles/openvswitch/tasks/post-config.yml b/ansible/roles/openvswitch/tasks/post-config.yml index d4e0b5e9b9..7d71387e3b 100644 --- a/ansible/roles/openvswitch/tasks/post-config.yml +++ b/ansible/roles/openvswitch/tasks/post-config.yml @@ -18,7 +18,7 @@ - name: Ensuring OVS bridge is properly setup become: true - command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ item.0 }} {{ item.1 }} + command: "{{ kolla_container_engine }} exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ item.0 }} {{ item.1 }}" register: status changed_when: status.stdout.find('changed') != -1 when: diff --git a/ansible/roles/ovs-dpdk/handlers/main.yml b/ansible/roles/ovs-dpdk/handlers/main.yml index 7dbe94f2d4..1bd5761e55 100644 --- a/ansible/roles/ovs-dpdk/handlers/main.yml +++ b/ansible/roles/ovs-dpdk/handlers/main.yml @@ -26,7 +26,7 @@ service_name: "ovsdpdk-db" service: "{{ ovsdpdk_services[service_name] }}" become: true - command: docker exec "{{ service.container_name }}" ovs-vsctl --no-wait show + command: "{{ kolla_container_engine }} exec {{ service.container_name }} ovs-vsctl --no-wait show" register: check_result until: check_result is success changed_when: False @@ -39,7 +39,7 @@ service: "{{ ovsdpdk_services[service_name] }}" become: true command: > - docker exec {{ service.container_name }} /bin/sh -c + {{ kolla_container_engine }} exec {{ service.container_name }} /bin/sh -c 'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init' register: status changed_when: status.stdout.find('changed') != -1 @@ -73,7 +73,7 @@ service: "{{ ovsdpdk_services[service_name] }}" become: true command: > - docker exec {{ service.container_name }} /bin/sh -c + {{ kolla_container_engine }} exec {{ service.container_name }} /bin/sh -c 'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init' register: status changed_when: status.stdout.find('changed') != -1 diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index 864c8a51b2..cbab1f6aab 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -1,7 +1,7 @@ --- - name: Checking Docker version become: true - command: docker --version + command: "{{ kolla_container_engine }} --version" register: result changed_when: false when: inventory_hostname in groups['baremetal'] diff --git a/ansible/roles/rabbitmq/tasks/restart_services.yml b/ansible/roles/rabbitmq/tasks/restart_services.yml index b2cf58773b..d9e2a1a6ab 100644 --- a/ansible/roles/rabbitmq/tasks/restart_services.yml +++ b/ansible/roles/rabbitmq/tasks/restart_services.yml @@ -19,4 +19,4 @@ service_name: "rabbitmq" service: "{{ rabbitmq_services[service_name] }}" become: true - command: "docker exec {{ service.container_name }} rabbitmqctl wait {{ rabbitmq_pid_file }}" + command: "{{ kolla_container_engine }} exec {{ service.container_name }} rabbitmqctl wait {{ rabbitmq_pid_file }}" diff --git a/ansible/roles/redis/tasks/check.yml b/ansible/roles/redis/tasks/check.yml index 6737ba1c0f..bd4a16dcf3 100644 --- a/ansible/roles/redis/tasks/check.yml +++ b/ansible/roles/redis/tasks/check.yml @@ -1,7 +1,7 @@ --- - name: Redis ping pong check become: true - command: "docker exec redis redis-cli -h {{ api_interface_address }} -a {{ redis_master_password }} ping" + command: "{{ kolla_container_engine }} exec redis redis-cli -h {{ api_interface_address }} -a {{ redis_master_password }} ping" register: redis_check changed_when: "redis_check.stdout != 'PONG'" failed_when: "redis_check.stdout != 'PONG'" diff --git a/ansible/roles/swift/tasks/reconfigure.yml b/ansible/roles/swift/tasks/reconfigure.yml index 1c0ef0014f..745626c44d 100644 --- a/ansible/roles/swift/tasks/reconfigure.yml +++ b/ansible/roles/swift/tasks/reconfigure.yml @@ -44,7 +44,7 @@ - name: Check the configs become: true - command: docker exec -u root {{ item.name }} /usr/local/bin/kolla_set_configs --check + command: "{{ kolla_container_engine }}exec -u root {{ item.name }} /usr/local/bin/kolla_set_configs --check" changed_when: false failed_when: false register: check_results diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml index a09aa95bd1..7848e4d4fa 100644 --- a/ansible/roles/swift/tasks/start.yml +++ b/ansible/roles/swift/tasks/start.yml @@ -1,10 +1,10 @@ --- - name: Looking up disks for Swift become: true - command: docker exec -t kolla_toolbox sudo -E ansible localhost + command: "{{ kolla_container_engine }} exec -t kolla_toolbox sudo -E ansible localhost -m find_disks - -a "name={{ swift_devices_name }} - match_mode={{ swift_devices_match_mode }}" + -a \"name={{ swift_devices_name }} + match_mode={{ swift_devices_match_mode }}\"" register: swift_disk_lookup changed_when: swift_disk_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1] | from_json).changed diff --git a/ansible/roles/zun/handlers/main.yml b/ansible/roles/zun/handlers/main.yml index d4bdf728bf..e1f31f9093 100644 --- a/ansible/roles/zun/handlers/main.yml +++ b/ansible/roles/zun/handlers/main.yml @@ -80,7 +80,7 @@ service_name: "zun-cni-daemon" service: "{{ zun_services[service_name] }}" become: true - command: "docker cp {{ service.container_name }}:/opt/loopback /opt/cni/bin/" + command: "{{ kolla_container_engine }} cp {{ service.container_name }}:/opt/loopback /opt/cni/bin/" # NOTE(yoctozepto): it would be cleaner to listen only on image change # but there is no such mechanism (yet) and container change should be # good enough (better than including config change triggers) diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index fd77dcc0bd..63ca05575e 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -71,6 +71,13 @@ workaround_ansible_issue_8743: yes # Optionally change the path to sysctl.conf modified by Kolla Ansible plays. #kolla_sysctl_conf_path: /etc/sysctl.conf +################ +# Container engine +################ + +# Valid options are [ docker ] +# kolla_container_engine: docker + ################ # Docker options ################