Allow pushing newly build containers to registry
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user