Skip to content

Commit 67cca0c

Browse files
Merge pull request #281 from konstruktoid/admin_ansible
add engine/admin/ansible/
2 parents be4879b + 5d9da64 commit 67cca0c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

_data/toc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ toc:
169169
title: Splunk logging driver
170170
- path: /engine/admin/dsc/
171171
title: PowerShell DSC Usage
172+
- path: /engine/admin/ansible/
173+
title: Using Ansible
172174
- path: /engine/admin/chef/
173175
title: Using Chef
174176
- path: /engine/admin/puppet/

engine/admin/ansible.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
description: Installation and using Docker via Ansible
3+
keywords:
4+
- ansible, installation, usage, docker, documentation
5+
title: Using Ansible
6+
---
7+
8+
# Using Ansible
9+
10+
> **Note**:
11+
> Please note this is a community contributed installation path.
12+
13+
## Requirements
14+
15+
To use this guide you'll need a working installation of
16+
[Ansible](https://www.ansible.com/) version 2.1.0 or later.
17+
18+
Requirements on the host that will execute the module:
19+
20+
```
21+
python >= 2.6
22+
docker-py >= 1.7.0
23+
Docker API >= 1.20
24+
```
25+
26+
## Installation
27+
28+
The `docker_container` module is a core module, and will ship with
29+
Ansible by default.
30+
31+
## Usage
32+
33+
Task example that pulls the latest version of the `nginx` image and
34+
runs a container. Bind address and ports are in the example defined
35+
as [a variable](https://docs.ansible.com/ansible/playbooks_variables.html).
36+
37+
```
38+
---
39+
- name: nginx container
40+
docker:
41+
name: nginx
42+
image: nginx
43+
state: reloaded
44+
ports:
45+
- "{{ nginx_bind_address }}:{{ nginx_port }}:{{ nginx_port }}"
46+
cap_drop: all
47+
cap_add:
48+
- setgid
49+
- setuid
50+
pull: always
51+
restart_policy: on-failure
52+
restart_policy_retry: 3
53+
volumes:
54+
- /some/nginx.conf:/etc/nginx/nginx.conf:ro
55+
tags:
56+
- docker_container
57+
- nginx
58+
...
59+
```
60+
61+
## Documentation
62+
63+
The documentation for the `ansible_container` module is present at
64+
[docs.ansible.com](https://docs.ansible.com/ansible/docker_container_module.html).
65+
66+
Documentation covering Docker images, networks and services is also present
67+
at [docs.ansible.com](https://docs.ansible.com/ansible/list_of_cloud_modules.html#docker).

0 commit comments

Comments
 (0)