---
- name: Create current_config directory
  become: yes
  file:
    path: '{{ current_config_dir }}'
    state: directory
    owner: zoox
    group: zoox

- name: Generate current_config from cal repo
  command: '{{ bin_root }}/bin/get_hardware_config --output_dir {{ current_config_dir }}'
  when: logbot_chum_uri is not defined

- name: Generate current_config from run (for LogBot)
  shell: |
    {{ bin_root }}/bin/generate_logbot_config {{ logbot_chum_uri }} {{ current_config_dir }}
  when: logbot_chum_uri is defined

- name: Generate masterlist from current_config json file
  shell: |
    {{ bin_root }}/bin/zci_masterlist --vehicle_config={{ current_config_dir }}/vehicle.json --output_pbtxt={{ current_config_dir }}/masterlist.pbtxt
