Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
af908176
Commit
af908176
authored
Mar 17, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial test of the docker module
parent
6a803f65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
0 deletions
+75
-0
test/integration/destructive.yml
+1
-0
test/integration/roles/test_docker/meta/main.yml
+20
-0
test/integration/roles/test_docker/tasks/main.yml
+54
-0
No files found.
test/integration/destructive.yml
View file @
af908176
...
...
@@ -17,3 +17,4 @@
-
{
role
:
test_mysql_db
,
tags
:
test_mysql_db
}
-
{
role
:
test_mysql_user
,
tags
:
test_mysql_user
}
-
{
role
:
test_mysql_variables
,
tags
:
test_mysql_variables
}
-
{
role
:
test_docker
,
tags
:
test_docker
}
test/integration/roles/test_docker/meta/main.yml
0 → 100644
View file @
af908176
# test code for the service module
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
dependencies
:
-
prepare_tests
test/integration/roles/test_docker/tasks/main.yml
0 → 100644
View file @
af908176
-
name
:
Install docker packages (yum)
yum
:
state
:
present
name
:
docker,docker-registry,python-docker-py
when
:
ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
-
name
:
Install docker packages (apt)
apt
:
state
:
present
# Note: add docker-registry when available
name
:
docker.io,python-docker
when
:
ansible_distribution in ['Ubuntu', 'Debian']
-
name
:
Start docker daemon
service
:
name
:
docker
state
:
started
-
name
:
Download busybox image
docker
:
image
:
busybox
state
:
present
pull
:
missing
-
name
:
Run a small script in busybox
docker
:
image
:
busybox
state
:
reloaded
pull
:
always
command
:
"
nc
-l
-p
2000
-e
xargs
-n1
echo
hello"
detach
:
True
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
busybox
|
awk
'{
print
$1
}'"
register
:
container_id
-
debug
:
var=container_id
-
name
:
Get the docker container ip
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
debug
:
var=container_ip
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
-
debug
:
var=docker_output
-
name
:
check that the script ran
assert
:
that
:
-
"
'hello
world'
in
docker_output.stdout_lines"
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