---
- name: Copy dnsmasq configuration
  command: >
    {{ container_engine }} exec bifrost_deploy
    bash -c 'export OS_CLOUD=bifrost &&
    ansible -vvvv target -i /bifrost/playbooks/inventory/target
    -m copy
    -a "src=/etc/bifrost/dell-switch-bmp.conf dest=/etc/dnsmasq.d/dell-switch-bmp.conf"
    -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python"'
    become: "{{ container_engine == 'podman' }}"

- name: Restart bifrost dnsmasq
  command: >
    {{ container_engine }} exec bifrost_deploy
    bash -c 'export OS_CLOUD=bifrost &&
    ansible -vvvv target -i /bifrost/playbooks/inventory/target
    -m service
    -a "name=dnsmasq state=restarted"
    -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python"'
  become: "{{ container_engine == 'podman' }}"

- name: Copy Dell switch BMP images
  command: >
    {{ container_engine }} exec bifrost_deploy
    bash -c 'export OS_CLOUD=bifrost &&
    ansible -vvvv target -i /bifrost/playbooks/inventory/target
    -m copy
    -a "src=/etc/bifrost/{{ item.dest }} dest={{ dell_switch_bmp_httpboot_path }}/{{ item.dest }}"
    -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python"'
  with_items: "{{ dell_switch_bmp_images }}"
  become: "{{ container_engine == 'podman' }}"
