marvinpinto.docker

docker

构建状态 Ansible Galaxy 许可证

这个 Ansible 角色使用户能够在类 Ubuntu 系统上安装最新的 Docker。它还提供了一个方便的库函数,用于验证 Docker 守护进程是否正在运行并且功能正常。

需求

此角色仅在类 Ubuntu 系统上工作。

角色变量

# 任何其他 Docker 服务选项
# 例如:'--dns 8.8.8.8 --dns 8.8.4.4 --userns-remap=default'
# docker_additional_service_opts: |
#   {
#     "userns-remap": "default",
#     "dns": [
#       "8.8.8.8",
#       "8.8.4.4"
#     ]
#   }
docker_additional_service_opts: |
  {}

示例

从 Ansible Galaxy 安装此模块到 './roles' 目录:

ansible-galaxy install marvinpinto.docker -p ./roles

在剧本中使用如下:

- hosts: 'servers'
  roles:
    - role: 'marvinpinto.docker'
      become: true
  tasks:
    - name: '确保 Docker 守护进程正常工作'
      become: true
      docker_ping:
      retries: 5
      delay: 10
      until: result|success
    - name: '你好,世界'
      docker:
        name: 'helloworld'
        image: 'hello-world'
        state: 'started'
关于项目

This Ansible role enables people to install the latest Docker on an Ubuntu-like system. It also provides a handy library function to validate that the Docker daemon is running and functional.

安装
ansible-galaxy install marvinpinto.docker
许可证
mit
下载
187k
拥有者
Computer nerd.