Last Updated: February 25, 2016
·
8.805K
· mmoya

Run a playbook chrooted in a local dir

Set chroot connection and directories in command line like:

$ sudo ansible-playbook -c chroot -i '/path/to/debootstrap,/path/to/febootstrap' my-cool-playbook.yml

You can also have chroot directories listed in the inventory file like any other hostname:

[chroots]
/path/to/debootstrap
/path/to/feboostrap
/path/to/lxc-image

and use them in a playbook, like:

---
- hosts: chroots
  connection: chroot
  tasks:
  ...

1 Response
Add your response

hi mmoya ,i have tryed your way to run playbook chroot but it'is still taking effect in local dir not chrooted dir , i am using ansible 1.9 .

over 1 year ago ·