---
- name: "create scripts dir"
  file:
    path: "{{ OS.mikbill.dirs.scripts }}"
    owner: root
    group: root
    mode: 0755
    state: directory

- name: "copy sbin scritps 1"
  copy:
    src: "{{ item.file }}"
    dest: "{{ OS.mikbill.dirs.scripts }}/{{ item.file }}"
    owner: root
    group: root
    mode: 0777
  loop:
    - { file: "mikbill_run.sh" }
    - { file: "mikbill_stop.sh" }
    - { file: "mikbill_pid_off" }
    - { file: "mikbill_pid_on" }

- name: "copy sbin scritps 2"
  template:
    src: "{{ item.file }}"
    dest: "{{ OS.mikbill.dirs.scripts }}/{{ item.file }}"
    owner: root
    group: root
    mode: 0777
  loop:
    - { file: "radius_start.sh" }
    - { file: "radius_stop.sh" }
