opsta.install_docker

安装Docker

这是一个Ansible角色,用于在Ubuntu主机上安装Docker并进行一些初始配置。

  • 安装Docker
  • 将ssh用户添加到docker组
  • 配置DOCKER_OPTS
  • 登录到私有Docker注册表
  • 安装docker-py

您可以在这里看到制作playbook、配置和示例命令的示例:https://github.com/winggundamth/ansible-wing-playbook

要求

角色变量

# 这是默认变量
install_docker_option: --storage-driver=overlay
install_docker_private_login: false
install_docker_py: false

# 这是可选变量
# 当install_docker_private_login为true时使用
install_docker_registry_username: registry
install_docker_registry_password: CHANGEDOCKERPASSWORDHERE
install_docker_registry_email: [email protected]
install_docker_registry_url: registry.example.com

# 用于RedHat/CentOS/Fedora。
install_docker_repo_url: https://download.docker.com/linux
install_docker_yum_repo_url: "{{ install_docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-ce.repo"
install_docker_yum_gpg_key: "{{ install_docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/gpg"

依赖

示例Playbook

- hosts: all
  gather_facts: no
  become: true
  roles:
    - winggundamth.install_docker
  vars_files:
    - "{{ install_docker_vars_file }}"

有用的标签列表

有一些有用的标签,可以用来维护Docker配置:

  • install-docker-private-login
  • install-docker-configure
  • install-docker
  • install-docker-py

许可证

MIT

作者信息

您可以在这里查看我的作品:https://github.com/winggundamth

关于项目

Ansible role to install Docker and do some initial configuration for Ubuntu host

安装
ansible-galaxy install opsta.install_docker
许可证
mit
下载
834
拥有者
We build scale