2018-11-11 02:11:10 +00:00
|
|
|
---
|
|
|
|
- block:
|
2019-03-09 14:12:58 +00:00
|
|
|
- name: Create local facts dir
|
|
|
|
file:
|
|
|
|
path: /etc/ansible/facts.d
|
|
|
|
state: directory
|
2018-11-11 02:11:10 +00:00
|
|
|
|
2019-03-09 14:12:58 +00:00
|
|
|
- name: Set current zigbee2mqtt version
|
|
|
|
set_fact:
|
2019-03-09 15:28:22 +00:00
|
|
|
zigbee2mqtt_current_version: "{{ (ansible_local.zigbee2mqtt | default (dict(version='0.0.0')))['version'] }}"
|
2018-11-11 02:11:10 +00:00
|
|
|
|
2019-03-09 14:12:58 +00:00
|
|
|
- debug:
|
|
|
|
msg: Current version is '{{ zigbee2mqtt_current_version }}'
|
2018-11-11 02:11:10 +00:00
|
|
|
|
2019-03-09 14:12:58 +00:00
|
|
|
- name: Create group '{{ zigbee2mqtt_group }}'
|
|
|
|
group:
|
|
|
|
name: "{{ zigbee2mqtt_group }}"
|
|
|
|
state: present
|
2018-11-11 02:11:10 +00:00
|
|
|
|
2019-03-09 14:12:58 +00:00
|
|
|
- name: Create user '{{ zigbee2mqtt_user }}'
|
|
|
|
user:
|
|
|
|
name: "{{ zigbee2mqtt_user }}"
|
|
|
|
group: "{{ zigbee2mqtt_group }}"
|
|
|
|
groups: "{{ zigbee2mqtt_secondary_groups }}"
|
2018-11-11 02:11:10 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|