2022-07-04 14:37:57 +02:00
|
|
|
---
|
|
|
|
{%- 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 }}
|
2022-07-04 15:25:12 +02:00
|
|
|
- source: {{ micromdm.mirror }}/v{{ micromdm.version }}/micromdm_v{{ micromdm.version }}.zip
|
2022-07-04 14:37:57 +02:00
|
|
|
- skip_verify: true
|
|
|
|
- enforce_toplevel: false
|
2022-07-04 15:25:12 +02:00
|
|
|
- if_missing: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}/build/{{ micromdm.os }}/micromdm
|
2022-07-04 14:37:57 +02:00
|
|
|
- watch_in:
|
|
|
|
- service: micromdm-service
|
|
|
|
|
|
|
|
micromdm-bin-symlink:
|
|
|
|
file.symlink:
|
|
|
|
- name: {{ micromdm.install_dir }}/micromdm
|
2022-07-04 15:25:12 +02:00
|
|
|
- target: {{ micromdm.release_dir }}/micromdm-{{ micromdm.version }}/build/{{ micromdm.os }}
|
2022-07-04 14:37:57 +02:00
|
|
|
|
2022-07-04 15:25:12 +02:00
|
|
|
micromdm-configpath-dir:
|
2022-07-04 14:37:57 +02:00
|
|
|
file.directory:
|
2022-07-04 15:25:12 +02:00
|
|
|
- name: {{ micromdm.config_path }}
|
2022-07-04 14:37:57 +02:00
|
|
|
- user: {{ micromdm.user.uid }}
|
|
|
|
- group: {{ micromdm.group.gid }}
|
2022-07-04 15:25:12 +02:00
|
|
|
- makedirs: true
|
2022-07-04 14:37:57 +02:00
|
|
|
- watch_in:
|
2022-07-04 15:25:12 +02:00
|
|
|
- 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
|
2022-07-04 14:37:57 +02:00
|
|
|
|
|
|
|
{%- for bin in ['mdmctl'] %}
|
|
|
|
micromdm-{{ bin }}-symlink:
|
|
|
|
file.symlink:
|
2022-07-04 15:25:12 +02:00
|
|
|
- name: /usr/local/bin/{{ bin }}
|
2022-07-04 14:37:57 +02:00
|
|
|
- target: {{ micromdm.install_dir }}/micromdm/{{ bin }}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
micromdm-cleanup:
|
|
|
|
software.cleanup:
|
|
|
|
- name: micromdm
|
|
|
|
- path: {{ micromdm.release_dir }}
|
|
|
|
- version: "{{ micromdm.version }}"
|