chd/deployments/zncServer/znc.yml
2018-11-15 12:43:36 -06:00

23 lines
984 B
YAML

- name: deploy znc server
hosts: dockerhosts
remote_user: josiah
tasks:
- name: update or create the directory
shell: cd /home/josiah/znc-docker/ && git pull
register: result
ignore_errors: True
# if the folder doesn't exist, clone source.
- command: cd /home/josiah && git clone https://github.com/jowj/znc-docker.git
when: result is failed
- name: build from latest version
shell: cd ~/znc-docker && docker build -t znc -f full/Dockerfile .
- name: Check if there are any existing mojo containers running and kill it
shell: docker ps | grep 'znc' | awk '{print $1}' | xargs docker kill
- name: Remove any existing containers using the znc name, its mine and i must have it
# this has to be a shell because command: isn't interactive
shell: docker container rm znc
- name: run the container (assumes the volume is already set up)
command: docker run -d -p 5000:5000 -v znc-cfg:/znc-data znc