Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Merge branch 'include_test_playbook'
Browse files Browse the repository at this point in the history
  • Loading branch information
ioO committed Mar 9, 2017
2 parents 28c3dfb + 922c7e6 commit 35ae997
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 7 additions & 0 deletions fake-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: A fake playbook
hosts: localhost

tasks:
- name: A simple message
shell: "echo foobar"
11 changes: 5 additions & 6 deletions testible-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# include vars of your vm
file: "host_vars/{{ vm }}"
name: testible
- name: "Create entry in local .ssh/config"
- name: Create entry in local .ssh/config
blockinfile:
dest: "/home/{{ host.user.local }}/.ssh/config"
# Add unique marker for each host because ansible will rewrite block with same marker
Expand Down Expand Up @@ -45,9 +45,8 @@
delay: 5

# include the playbook to test
#- name: "Include the playbook to test"
#hosts: {{ vm }}
#include: {{ playbook }}
- name: Include the playbook to test
include: "{{ playbook }}"

- name: Tasks to shutdown the vm and clean localhost
hosts: localhost
Expand All @@ -57,13 +56,13 @@
- name: Shutdown the vm
command: "VBoxManage controlvm {{ testible.host.vbox.uuid }} acpipowerbutton"

- name: "Remove entry in local .ssh/config"
- name: Remove entry in local .ssh/config
blockinfile:
dest: "/home/{{ host.user.local }}/.ssh/config"
marker: "# {mark} ANSIBLE MANAGED BLOCK FOR {{ testible.host.alias.lan }}"
state: absent

- name: "Remove host ip in .ssh/known_hosts"
- name: Remove host ip in .ssh/known_hosts
lineinfile:
dest: "/home/{{ host.user.local }}/.ssh/known_hosts"
state: absent
Expand Down

0 comments on commit 35ae997

Please sign in to comment.