aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/roles/systemd_depend_iface/tasks/main.yml
blob: d99a445824f0b5ec3e02bfc04ed4b4b6c92ab193 (plain) (tree)



















                                                                                                         
                                     



                                             
                                            
                                      
- name: Create override directory
  become: true
  ansible.builtin.file:
    path: '/etc/systemd/system/{{ service }}.service.d'
    state: directory
    owner: root
    group: root
    mode: '755'
  loop: '{{ systemd_depend_iface_services }}'
  loop_control:
    loop_var: service

- name: Create service override
  become: true
  ansible.builtin.template:
    src: override.conf.j2
    dest: '/etc/systemd/system/{{ service }}.service.d/depend_iface_{{ systemd_depend_iface_name }}.conf'
    owner: root
    group: root
    mode: '644'
  notify: systemd_depend_iface_reload
  loop: '{{ systemd_depend_iface_services }}'
  loop_control:
    loop_var: service

- name: Reload systemd services if necessary
  ansible.builtin.meta: flush_handlers