diff --git a/defaults/main.yml b/defaults/main.yml index 7eb0f03..432b0f5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,3 +6,4 @@ state: present # or running, build, absent execute: smart # or always or never disable_template: false docker_profiles: [] +docker_push: false # only works with build currently diff --git a/tasks/build.yml b/tasks/build.yml index ed56fe0..58e0e7d 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -6,11 +6,16 @@ community.docker.docker_compose: project_src: "{{ service_dir | mandatory }}" state: present - restarted: true + restarted: false recreate: smart build: true remove_orphans: true profiles: docker_profiles when: (compose_files.changed and execute == "smart") or execute == "always" +- name: Push compose container images + ansible.builtin.shell: + chdir: "{{ service_dir | mandatory }}" + cmd: "docker-compose push" + when: docker_push | bool # vim: ft=yaml.ansible