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
b5580389
Commit
b5580389
authored
Nov 15, 2013
by
Rene Moser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
host: added test playbook
parent
0c70e898
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
test/playbook-module-host.yml
+98
-0
No files found.
test/playbook-module-host.yml
0 → 100644
View file @
b5580389
---
# run with option -i localhost
# need root permissions
-
name
:
host module testing
hosts
:
localhost
connection
:
local
gather_facts
:
no
sudo
:
yes
pre_tasks
:
-
name
:
backup /etc/hosts
command
:
cp /etc/hosts /etc/hosts.origin
post_tasks
:
-
name
:
restore /etc/hosts
command
:
cp /etc/hosts.origin /etc/hosts
tasks
:
-
name
:
test add a record
host
:
hostname=foobar ip=192.168.123.1
register
:
result
failed_when
:
not result.changed
-
name
:
test error handling only hostname given on present
host
:
hostname=foobar
register
:
result
failed_when
:
result.changed
-
name
:
test error handling only ip given on present
host
:
ip=192.168.123.1
register
:
result
failed_when
:
result.changed
-
name
:
test record exists
host
:
hostname=foobar ip=192.168.123.1
register
:
result
failed_when
:
result.changed
-
name
:
test remove record using hostname
host
:
hostname=foobar state=absent
register
:
result
failed_when
:
not result.changed
-
name
:
test remove not existing record using hostname
host
:
hostname=foobar state=absent
register
:
result
failed_when
:
result.changed
-
name
:
test add a record again
host
:
hostname=foobar ip=192.168.123.1
register
:
result
failed_when
:
not result.changed
-
name
:
test remove record using ip
host
:
ip=192.168.123.1 state=absent
register
:
result
failed_when
:
not result.changed
-
name
:
test remove not existing record using ip
host
:
ip=192.168.123.1 state=absent
register
:
result
failed_when
:
result.changed
-
name
:
test add a record with alias
host
:
hostname=foobar ip=192.168.123.1 aliases=foobar.com,foobar.net
register
:
result
failed_when
:
not result.changed
-
name
:
test add an existing record with alias
host
:
hostname=foobar ip=192.168.123.1 aliases=foobar.com,foobar.net
register
:
result
failed_when
:
result.changed
-
name
:
test add an existing record with changed alias
host
:
hostname=foobar ip=192.168.123.1 aliases=foobar.net,foobar.com
register
:
result
failed_when
:
not result.changed
-
name
:
test remove aliases from existing record
host
:
hostname=foobar ip=192.168.123.1
register
:
result
failed_when
:
not result.changed
-
name
:
test add aliases for existing record
host
:
hostname=foobar ip=192.168.123.1 aliases=foobar.net,foobar.com
register
:
result
failed_when
:
not result.changed
-
name
:
test change ip on existing record
host
:
hostname=foobar ip=192.168.123.2
register
:
result
failed_when
:
not result.changed
-
name
:
test change hostname on existing record
host
:
hostname=barfoo ip=192.168.123.2
register
:
result
failed_when
:
not result.changed
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