Created
October 17, 2016 08:23
-
-
Save mgedmin/951deba9de26b213e6691f15d52783af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: scripts to create docker images | |
| copy: src={{ item.script }} dest=./{{ item.script }} mode=0775 | |
| register: scripts | |
| with_items: | |
| - { image: foo-test-image, script: build-docker-image.sh } | |
| - { image: foo-debian-image, script: build-debian-image.sh } | |
| - { image: foo-packaging-image, script: build-packaging-image.sh } | |
| tags: docker | |
| - name: list docker images | |
| command: docker images --format "{{"{{"}} .Repository {{"}}"}}" | |
| register: docker_images | |
| changed_when: false | |
| always_run: true | |
| tags: docker | |
| - name: build docker images | |
| command: ./{{ item.item.script }} | |
| when: item.changed or item.item.image not in docker_images.stdout_lines | |
| with_items: "{{ scripts.results }}" | |
| tags: docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment