2024-06-08 19:45:32 +00:00
|
|
|
---
|
|
|
|
- name: create docker-mounted-files directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "/usr/local/docker-mounted-files/docker-sensors-polling"
|
|
|
|
state: directory
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Template sensors-polling conf.yml
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: templates/sensors-polling-conf.yml.j2
|
|
|
|
dest: /usr/local/docker-mounted-files/docker-sensors-polling/conf.yml
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Build sensors-polling image
|
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: role_build_container_image
|
|
|
|
vars:
|
|
|
|
image: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- repo_url: https://git.scimetis.net/yohan/docker-sensors-polling.git
|
|
|
|
repo_name: docker-sensors-polling
|
|
|
|
name: sensors-polling
|
|
|
|
result_var: build_result
|
|
|
|
|
|
|
|
- debug: var=build_result
|
|
|
|
when: build_result.changed
|
|
|
|
|
|
|
|
- name: Create sensors-polling container
|
|
|
|
containers.podman.podman_container:
|
|
|
|
name: sensors-polling
|
2024-06-09 08:21:35 +00:00
|
|
|
image: "localhost/sensors-polling:{{ commit }}"
|
2024-06-08 19:45:32 +00:00
|
|
|
network:
|
|
|
|
- host
|
|
|
|
env:
|
|
|
|
TZ: "Europe/Paris"
|
|
|
|
privileged: true
|
|
|
|
restart_policy: always
|
2024-06-09 21:09:38 +00:00
|
|
|
stop_timeout: 20
|
2024-06-08 19:45:32 +00:00
|
|
|
volume:
|
|
|
|
- /usr/local/docker-mounted-files/docker-sensors-polling/conf.yml:/root/conf.yml
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Prune images
|
|
|
|
containers.podman.podman_prune:
|
|
|
|
image: true
|
2024-06-09 09:04:41 +00:00
|
|
|
image_filters:
|
|
|
|
dangling_only: false
|
2024-06-08 19:45:32 +00:00
|
|
|
become: true
|