paulbsd-salt/states/micromdm/install.sls
Paul Lecuq 1a38f6afa5
All checks were successful
continuous-integration/drone/push Build is passing
fix in deployment process for some soft
2023-06-23 08:57:12 +02:00

67 lines
1.8 KiB
Plaintext

---
{%- from "micromdm/map.jinja" import micromdm with context %}
micromdm-group:
group.present:
- name: micromdm
- gid: {{ micromdm.group.gid }}
- watch_in:
- service: micromdm-service
micromdm-user:
user.present:
- name: micromdm
- uid: {{ micromdm.user.uid }}
- gid: {{ micromdm.group.gid }}
- allow_uid_change: true
- allow_gid_change: true
- home: /var/lib/micromdm
- watch_in:
- service: micromdm-service
micromdm-archive-extract:
archive.extracted:
- name: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}
- source: {{ micromdm.mirror }}/v{{ micromdm.version }}/micromdm_v{{ micromdm.version }}.zip
- skip_verify: true
- enforce_toplevel: false
- if_missing: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}/build/{{ micromdm.os }}/micromdm
- watch_in:
- service: micromdm-service
micromdm-bin-symlink:
file.symlink:
- name: {{ micromdm.install_dir }}/micromdm
- target: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}/build/{{ micromdm.os }}
- force: true
micromdm-configpath-dir:
file.directory:
- name: {{ micromdm.config_path }}
- user: {{ micromdm.user.uid }}
- group: {{ micromdm.group.gid }}
- makedirs: true
- watch_in:
- service: micromdm-service
micromdm-filerepo-dir:
file.directory:
- name: {{ micromdm.filerepo }}
- user: {{ micromdm.user.uid }}
- group: {{ micromdm.group.gid }}
- makedirs: true
- watch_in:
- service: micromdm-service
{%- for bin in ['mdmctl'] %}
micromdm-{{ bin }}-symlink:
file.symlink:
- name: /usr/local/bin/{{ bin }}
- target: {{ micromdm.install_dir }}/micromdm/{{ bin }}
{%- endfor %}
micromdm-cleanup:
software.cleanup:
- name: micromdm
- path: {{ micromdm.release_dir }}
- version: "{{ micromdm.version }}"