From f3828ebdd77fbd459c612a8143321b2b658890aa Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 18:09:04 +0200 Subject: [PATCH] [PR #6824/59479b4a backport][stable-6] chroot: added an example (#6898) chroot: added an example (#6824) * chroot: added an example Added a simple example of chroot connection plugin Fixes: #6365 Signed-off-by: Abhijeet Kasurde * Apply suggestions from code review Co-authored-by: Felix Fontein --------- Signed-off-by: Abhijeet Kasurde Co-authored-by: Felix Fontein (cherry picked from commit 59479b4abd5efe093c34311c4ee90ebf19105817) Co-authored-by: Abhijeet Kasurde --- plugins/connection/chroot.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/connection/chroot.py b/plugins/connection/chroot.py index ef6d5566d3..0b171c118b 100644 --- a/plugins/connection/chroot.py +++ b/plugins/connection/chroot.py @@ -48,6 +48,25 @@ DOCUMENTATION = ''' default: chroot ''' +EXAMPLES = r""" +# Static inventory file +# +# [chroots] +# /path/to/debootstrap +# /path/to/feboostrap +# /path/to/lxc-image +# /path/to/chroot + +# playbook +--- +- hosts: chroots + connection: community.general.chroot + tasks: + - debug: + msg: "This is coming from chroot environment" + +""" + import os import os.path import subprocess