mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-04-27 12:22:42 +02:00
update playbook
This commit is contained in:
parent
4d596a2736
commit
815d936695
@ -1,6 +1,10 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- hosts: all
|
- name: shadowsocks-libev deployment for ubuntu/debian
|
||||||
|
|
||||||
|
hosts: vps
|
||||||
|
|
||||||
|
gather_facts: yes
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
dns_addr: 8.8.8.8
|
dns_addr: 8.8.8.8
|
||||||
@ -10,12 +14,13 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- fail: msg='ensure os is debian/ubuntu'
|
||||||
|
when: 'ansible_distribution not in ["Debian", "Ubuntu"]'
|
||||||
|
|
||||||
- name: ensure docker is installed
|
- name: ensure docker is installed
|
||||||
apt:
|
shell: 'curl -sSL https://get.docker.com | sh'
|
||||||
name: docker.io
|
args:
|
||||||
default_release: jessie-backports
|
creates: /usr/bin/docker
|
||||||
update_cache: yes
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: ensure docker is running
|
- name: ensure docker is running
|
||||||
service:
|
service:
|
||||||
@ -30,13 +35,12 @@
|
|||||||
- name: ensure docker-py is installed
|
- name: ensure docker-py is installed
|
||||||
pip:
|
pip:
|
||||||
name: docker-py
|
name: docker-py
|
||||||
version: 1.2.3
|
|
||||||
executable: pip2
|
executable: pip2
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: ensure shadowsocks is started
|
- name: ensure shadowsocks is started
|
||||||
docker:
|
docker:
|
||||||
name: shadowsocks
|
name: shadowsocks_shadowsocks_1
|
||||||
image: vimagick/shadowsocks-libev
|
image: vimagick/shadowsocks-libev
|
||||||
ports:
|
ports:
|
||||||
- "{{port}}:8388"
|
- "{{port}}:8388"
|
||||||
@ -49,7 +53,7 @@
|
|||||||
|
|
||||||
- name: wait for shadowsocks
|
- name: wait for shadowsocks
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ansible_eth0.ipv4.address}}"
|
host: "{{ansible_ssh_host|d(inventory_hostname)}}"
|
||||||
port: "{{port}}"
|
port: "{{port}}"
|
||||||
delay: 5
|
delay: 5
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user