#####################################
### someone's ansible provisioner ###
#####################################
# Part of: https://git.somenet.org/root/pub/somesible.git
# 2017-2025 by someone <someone@somenet.org>
#
---
- name: make sure /etc/systemd/system-preset/ exists
  file:
    path: "/etc/systemd/system-preset/"
    state: directory
    mode: 0755
    owner: "root"
    group: "root"


- name: copy 99-somesible-defaults.preset
  copy:
    src: "{{item}}"
    dest: "/etc/systemd/system-preset/99-somesible-defaults.preset"
  with_first_found:
    - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/99-somesible-defaults.preset"
    - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/99-somesible-defaults.preset"
    - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/99-somesible-defaults.preset"
    - "default/99-somesible-defaults.preset"


- name: reload systemd
  systemd:
    daemon_reload: yes
