paulbsd-salt/states/micromdm/install.sls
Paul Lecuq cd46368ad3
Some checks failed
continuous-integration/drone/push Build is failing
added micromdm state
2022-07-04 14:37:57 +02:00

56 lines
1.5 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 }}/micromdm_v{{ micromdm.version }}.zip
- skip_verify: true
- enforce_toplevel: false
- if_missing: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}/micromdm
- watch_in:
- service: micromdm-service
micromdm-bin-symlink:
file.symlink:
- name: {{ micromdm.install_dir }}/micromdm
- target: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}
micromdm-data-dir:
file.directory:
- name: {{ micromdm.data_dir }}
- user: {{ micromdm.user.uid }}
- group: {{ micromdm.group.gid }}
- watch_in:
- service: micromdm-service
{%- for bin in ['mdmctl'] %}
micromdm-{{ bin }}-symlink:
file.symlink:
- name: /usr/local/sbin/{{ bin }}
- target: {{ micromdm.install_dir }}/micromdm/{{ bin }}
{%- endfor %}
micromdm-cleanup:
software.cleanup:
- name: micromdm
- path: {{ micromdm.release_dir }}
- version: "{{ micromdm.version }}"