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:
...
Written by Maykel Moya
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ansible
Authors
Misha Behersky
78.83K
tartansandal
73.25K
Related Tags
#ansible
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#