noticket - reorganized podman
This commit is contained in:
56
ansible/roles/podman/tasks/containers/home/hass.yml
Normal file
56
ansible/roles/podman/tasks/containers/home/hass.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: create home-assistant host directory volumes
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ podman_user }}"
|
||||
group: "{{ podman_user }}"
|
||||
mode: 0755
|
||||
notify: restorecon podman
|
||||
loop:
|
||||
- "{{ hass_path }}/media"
|
||||
- "{{ hass_path }}/config"
|
||||
|
||||
- name: copy configuration and automations
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "files/hass/{{ item }}"
|
||||
dest: "{{ hass_path }}/config/{{ item }}"
|
||||
owner: "{{ podman_user }}"
|
||||
group: "{{ podman_user }}"
|
||||
mode: 0644
|
||||
notify: restorecon podman
|
||||
loop:
|
||||
- configuration.yaml
|
||||
- automations.yaml
|
||||
|
||||
- name: flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- import_tasks: podman/podman-check.yml
|
||||
vars:
|
||||
container_name: hass
|
||||
container_image: "{{ image }}"
|
||||
|
||||
- name: create home-assistant server container
|
||||
become: true
|
||||
become_user: "{{ podman_user }}"
|
||||
containers.podman.podman_container:
|
||||
name: hass
|
||||
image: "{{ image }}"
|
||||
restart_policy: on-failure:3
|
||||
log_driver: journald
|
||||
cap_add:
|
||||
- CAP_NET_RAW
|
||||
- CAP_NET_BIND_SERVICE
|
||||
volumes:
|
||||
- "{{ hass_path }}/config:/config"
|
||||
- "{{ hass_path }}/media:/share"
|
||||
ports:
|
||||
- "8123:8123"
|
||||
|
||||
- name: create systemd startup job for hass
|
||||
include_tasks: podman/systemd-generate.yml
|
||||
vars:
|
||||
container_name: hass
|
||||
Reference in New Issue
Block a user