Browse Source

add example playbooks for testing against local docker container

master
Markus Bergholz 8 months ago
parent
commit
574474f097
4 changed files with 29 additions and 0 deletions
  1. +3
    -0
      ansible/debian.dockerfile
  2. +17
    -0
      ansible/test_docker.yml
  3. +3
    -0
      ansible/test_inventory.ini
  4. +6
    -0
      ansible/test_roles.yml

+ 3
- 0
ansible/debian.dockerfile View File

@ -0,0 +1,3 @@
FROM debian:10
RUN apt update && apt install -y init sudo python

+ 17
- 0
ansible/test_docker.yml View File

@ -0,0 +1,17 @@
---
- hosts: localhost
connection: local
gather_facts: False
tasks:
- name: add container to inventory
add_host:
name: debian
ansible_connection: docker
changed_when: false
- name: test my debian role
include_role:
name: deb
apply:
delegate_to: debian

+ 3
- 0
ansible/test_inventory.ini View File

@ -0,0 +1,3 @@
[testing]
debian ansible_connection=docker

+ 6
- 0
ansible/test_roles.yml View File

@ -0,0 +1,6 @@
---
- hosts: debian
gather_facts: True
roles:
- deb

Loading…
Cancel
Save