Retrieve container logs.

This commit is contained in:
yohan 2023-10-21 00:03:41 +02:00
parent f0a4e1bc0b
commit 2a85188062

View File

@ -176,42 +176,50 @@
- name: Create image build directory - name: Create image build directory
ansible.builtin.file: ansible.builtin.file:
path: /root/build path: "/home/{{ user }}/build_docker-duplicity"
state: directory state: directory
when: when:
- local_duplicity_image.msg is defined - local_duplicity_image.msg is defined
- '"Cannot find the image" in local_duplicity_image.msg' - '"Cannot find the image" in local_duplicity_image.msg'
remote_user: "{{ user }}"
delegate_to: 172.17.0.1
- name: Clone docker-duplicity repo - name: Clone docker-duplicity repo
ansible.builtin.git: ansible.builtin.git:
repo: 'https://git.scimetis.net/yohan/docker-duplicity.git' repo: 'https://git.scimetis.net/yohan/docker-duplicity.git'
dest: /root/build dest: "/home/{{ user }}/build_docker-duplicity"
clone: yes clone: yes
version: dev version: dev
update: no update: no
when: when:
- local_duplicity_image.msg is defined - local_duplicity_image.msg is defined
- '"Cannot find the image" in local_duplicity_image.msg' - '"Cannot find the image" in local_duplicity_image.msg'
remote_user: "{{ user }}"
delegate_to: 172.17.0.1
- name: Build duplicity image - name: Build duplicity image
community.docker.docker_image: community.docker.docker_image:
name: duplicity name: duplicity
tag: "{{ tag }}" tag: "{{ tag }}"
build: build:
path: /root/build/docker-duplicity path: "/home/{{ user }}/build_docker-duplicity"
source: build source: build
docker_host: tcp://127.0.0.1:2375
when: when:
- local_duplicity_image.msg is defined - local_duplicity_image.msg is defined
- '"Cannot find the image" in local_duplicity_image.msg' - '"Cannot find the image" in local_duplicity_image.msg'
remote_user: "{{ user }}"
delegate_to: 172.17.0.1
become: true
- name: Remove image build directory - name: Remove image build directory
ansible.builtin.file: ansible.builtin.file:
path: /root/build path: "/home/{{ user }}/build_docker-duplicity"
state: absent state: absent
when: when:
- local_duplicity_image.msg is defined - local_duplicity_image.msg is defined
- '"Cannot find the image" in local_duplicity_image.msg' - '"Cannot find the image" in local_duplicity_image.msg'
remote_user: "{{ user }}"
delegate_to: 172.17.0.1
- name: Install jsondiff from pip - name: Install jsondiff from pip
ansible.builtin.pip: ansible.builtin.pip:
@ -227,7 +235,8 @@
entrypoint: entrypoint:
- "ansible-playbook" - "ansible-playbook"
- "gen_bootstrap.yml" - "gen_bootstrap.yml"
auto_remove: true output_logs: true
detach: false
network_mode: host network_mode: host
working_dir: "/home/{{ user }}/repository/docker-duplicity-stack" working_dir: "/home/{{ user }}/repository/docker-duplicity-stack"
volumes: volumes: