Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
init
Commits
96f397df
Commit
96f397df
authored
Mar 13, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docker
parent
83454e19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
5 deletions
+92
-5
defaults/main.yml
defaults/main.yml
+2
-0
tasks/docker.yml
tasks/docker.yml
+81
-0
tasks/fish.yml
tasks/fish.yml
+6
-5
tasks/main.yml
tasks/main.yml
+3
-0
No files found.
defaults/main.yml
View file @
96f397df
...
@@ -6,4 +6,6 @@ mirror_debian: http://deb.debian.org
...
@@ -6,4 +6,6 @@ mirror_debian: http://deb.debian.org
mirror_debian_security
:
http://security.debian.org
mirror_debian_security
:
http://security.debian.org
mirror_ubuntu
:
http://archive.ubuntu.com
mirror_ubuntu
:
http://archive.ubuntu.com
mirror_ubuntu_security
:
http://security.ubuntu.com
mirror_ubuntu_security
:
http://security.ubuntu.com
mirror_docker
:
https://download.docker.com
china_mirror
:
false
china_mirror
:
false
install_docker
:
false
tasks/docker.yml
0 → 100644
View file @
96f397df
-
name
:
China mirror for Docker
set_fact
:
mirror_docker
:
https://mirrors.ustc.edu.cn/docker-ce
when
:
"
china_mirror"
-
name
:
Docker 源公钥
become
:
true
apt_key
:
url
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/gpg'
-
name
:
Docker 源
become
:
true
apt_repository
:
repo
:
'
deb
[arch=amd64]
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}
{{
ansible_distribution_release
}}
stable'
filename
:
docker
-
name
:
安装 Docker
become
:
true
apt
:
name
:
docker-ce,python-backports-shutil-get-terminal-size,python-backports.ssl-match-hostname,python-pip
update_cache
:
yes
state
:
latest
-
name
:
docker user group
become
:
true
user
:
name
:
'
{{ansible_user_id}}'
append
:
true
groups
:
docker
when
:
"
ansible_user_id
!=
'root'"
-
name
:
docker-compose 清理 pip
file
:
path
:
~/.pip
state
:
absent
-
name
:
docker-compose 清理 easy install
become
:
true
file
:
path
:
/usr/local/lib/python2.7/dist-packages/easy-install.pth
state
:
absent
-
name
:
docker-compose pip
become
:
true
pip
:
name
:
pip
state
:
latest
when
:
"
not
china_mirror"
-
name
:
docker-compose
become
:
true
pip
:
name
:
docker-compose
state
:
latest
when
:
"
not
china_mirror"
-
name
:
docker-compose 国内
become
:
true
pip
:
name
:
pip
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror"
-
name
:
docker-compose 国内
become
:
true
pip
:
name
:
docker-compose
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror"
-
name
:
docker 配置 创建目录
become
:
true
file
:
name
:
/etc/docker
state
:
directory
-
name
:
docker 配置
become
:
true
copy
:
content
:
|
{
"live-restore": true
}
dest
:
/etc/docker/daemon.json
-
name
:
docker 启动
become
:
true
systemd
:
name
:
docker
enabled
:
yes
state
:
started
when
:
ansible_virtualization_type != 'docker'
tasks/fish.yml
View file @
96f397df
...
@@ -19,8 +19,9 @@
...
@@ -19,8 +19,9 @@
file
:
file
:
name
:
'
~/.config/fish/completions'
name
:
'
~/.config/fish/completions'
state
:
directory
state
:
directory
#- name: 终端环境 fish 自动填充 docker
-
name
:
终端环境 fish 自动填充 docker
# copy:
copy
:
# src: /usr/share/fish/vendor_completions.d/docker.fish
src
:
/usr/share/fish/vendor_completions.d/docker.fish
# dest: '~/.config/fish/completions/docker.fish'
dest
:
'
~/.config/fish/completions/docker.fish'
# remote_src: yes
remote_src
:
yes
when
:
"
install_docker"
tasks/main.yml
View file @
96f397df
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
-
name
:
redhat configures
-
name
:
redhat configures
include_tasks
:
redhat_configures.yml
include_tasks
:
redhat_configures.yml
when
:
"
ansible_os_family
==
'RedHat'"
when
:
"
ansible_os_family
==
'RedHat'"
-
name
:
docker
include_tasks
:
docker.yml
when
:
"
ansible_os_family
==
'Debian'
and
install_docker"
-
name
:
fish
-
name
:
fish
include_tasks
:
fish.yml
include_tasks
:
fish.yml
when
:
"
ansible_os_family
==
'Debian'"
# RedHat has too many problems on fish, so aborted
when
:
"
ansible_os_family
==
'Debian'"
# RedHat has too many problems on fish, so aborted
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment