From: Lorin Hochstein Date: Sun, 5 Feb 2017 21:28:50 +0000 (-0800) Subject: add publish-local X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=f03a3f2cd087773fe7b5e604918ca753a21a35b6;p=ansiblebook.git add publish-local --- diff --git a/ch13/Makefile b/ch13/Makefile index 6dff512..e5d5212 100644 --- a/ch13/Makefile +++ b/ch13/Makefile @@ -1,4 +1,7 @@ -.PHONY: start publish build +.PHONY: start publish build local + +local: + ansible-playbook publish-local.yml publish: build ansible-playbook publish.yml diff --git a/ch13/publish-local.yml b/ch13/publish-local.yml new file mode 100644 index 0000000..c07eceb --- /dev/null +++ b/ch13/publish-local.yml @@ -0,0 +1,20 @@ +- name: publish images to local docker registry + hosts: localhost + gather_facts: False + vars: + repo_port: 5000 + repo: "localhost:{{repo_port}}" + image: ansiblebook/nginx-ghost + tasks: + - name: start a registry locally + docker_container: + name: registry + image: registry:2 + ports: "{{ repo_port }}:5000" + - debug: + msg: name={{ image }} repo={{ repo }}/{{ image }} + - name: tag the nginx-ghost image to the repository + docker_image: + name: "{{ image }}" + repository: "{{ repo }}/{{ image }}" + push: yes