paulbsd-salt/states/micromdm/install.sls
Paul Lecuq 2933d3985e
All checks were successful
continuous-integration/drone/push Build is passing
updated micromdm state
2022-07-04 15:25:12 +02:00

66 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 }}
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 }}"