diff --git a/defaults/main.yml b/defaults/main.yml index b8a8ae6..351d644 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,4 +9,4 @@ hass_SQl_target_file: / hass_db_password: toto hass_repo: git hass_repo_branch: master -hass_user: [] \ No newline at end of file +hass_user: [] diff --git a/tasks/main.yml b/tasks/main.yml index a59a510..855196a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,9 +35,10 @@ become: yes - name: add {{user.name}} to hass group + become: true user: name: "{{ item }}" - groups: docker + groups: hass append: true with_items: "{{ hass_user }}" @@ -65,10 +66,11 @@ - name: install conf file git: dest: "{{hass_conf_folder}}" # required. The path of where the repository should be checked out. This parameter is required, unless C(clone) is set to C(no). - repo: "{{hass_repo}}" # required. git, SSH, or HTTP(S) protocol address of the git repository. + repo: "{{hass_repo}}" # required. git, SSH, or HTTP(S) protocol address of the git repository. clone: yes # not required. If C(no), do not clone the repository if it does not exist locally version: "{{hass_repo_branch}}" notify: restart hass + become: true when: hass_repo_exist.stat.exists == false - name: change owner