add connection plugin for buildah (#26170)

* add connection plugin for buildah

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

 * create a method to invoke buildah
 * mount container filesystem persistently so we can access it
   during put and fetch
 * use copyfile function for copying files

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* revert tests

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* progress

(this will be squashed into a single commit before merge)

 * add docs for the conn plugin
 * fix issue invoking the integration tests
 * add a way to invoke commands inside the container as a different user

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fix shellcheck warning

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
This commit is contained in:
Tomas Tomecek 2017-07-12 04:36:25 +02:00 committed by Brian Coca
commit 5b898a7732
6 changed files with 197 additions and 0 deletions

View file

@ -0,0 +1,5 @@
- hosts: buildah-container
connection: buildah
gather_facts: no
roles:
- { role: connection_buildah }

View file

@ -0,0 +1 @@
needs/root

View file

@ -0,0 +1 @@
../connection_posix/test.sh

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eux
ANSIBLE_TEST_REMOTE_INTERPRETER='' ./posix.sh "$@"
ANSIBLE_TEST_REMOTE_INTERPRETER='' ANSIBLE_REMOTE_USER="1000" ./posix.sh "$@"

View file

@ -0,0 +1,12 @@
[buildah]
buildah-container ansible_ssh_pipelining=true
[buildah:vars]
# 1. install buildah
# 2. create container:
# $ sudo buildah from --name=buildah-container python:2
# 3. run test:
# $ ANSIBLE_TEST_REMOTE_INTERPRETER= ansible-test integration --local connection_buildah
# 6. remove container
# $ sudo buildah rm buildah-container
ansible_host=buildah-container
ansible_connection=buildah