1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Improve local testing (#33)

This commit is contained in:
Sergey 2020-05-10 13:08:34 +03:00 committed by GitHub
parent cc8d4bb451
commit 6d0a24b52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 30 deletions

View file

@ -17,7 +17,7 @@
git:
dest: "{{ repo_dir }}"
repo: "{{ repo_url }}"
version: "{{ pr_branch|default('master') }}"
version: "{{ pr_branch|default(omit) }}"
refspec: "{{ pr_refspec|default(omit) }}"
force: true
register: git_clone
@ -49,6 +49,7 @@
ansible-galaxy collection build --output-path {{ temp_collect }} --force
args:
chdir: "{{ repo_dir }}"
executable: bash
- name: Find a path of collection file
find:
@ -63,6 +64,7 @@
ansible-galaxy collection install {{ file_path.files.0.path }} --force
args:
chdir: "{{ repo_dir }}"
executable: bash
- name: Install collection for root
become: true
@ -71,3 +73,5 @@
ansible-galaxy collection install {{ file_path.files.0.path }} --force
args:
chdir: "{{ repo_dir }}"
executable: bash
when: install_root|default(true)|bool

View file

@ -12,3 +12,5 @@
{% if ansible_venv is defined %}source {{ ansible_venv }}/bin/activate; {% endif %}
{{ repo_dir }}/ci/run_connection_test.sh
args:
chdir: "{{ repo_dir }}"

View file

@ -6,7 +6,8 @@
distro: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}"
tasks:
- become: true
- when: os_setup|default(true)|bool
become: true
block:
- name: Install Python3 and pip
@ -39,32 +40,16 @@
pip:
name: pip
extra_args: --upgrade
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
- name: Install virtualenv
pip:
name:
- virtualenv
when: ansible_venv is defined
- name: Remove virtualenv if need
file:
path: "{{ ansible_venv }}"
state: absent
when:
- clean_venv|default(false)|bool
- ansible_venv is defined
- name: Install ansible
pip:
name: ansible
version: "{{ ansible_pip_version }}"
extra_args: --upgrade
virtualenv: "{{ ansible_venv|default(omit) }}"
virtualenv_site_packages: "{{ ansible_venv_site_packages|default(omit) }}"
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
when:
- ansible_venv is defined
when: ansible_venv is defined
- name: Install repositories if need
include_tasks: install_repos.yml
@ -77,11 +62,32 @@
- git
- vim
- name: Get podman version
shell: |
podman version
buildah version
podman info --debug
buildah info --debug
conmon --version
runc --version
- name: Remove virtualenv if need
file:
path: "{{ ansible_venv }}"
state: absent
when:
- clean_venv|default(false)|bool
- ansible_venv is defined
- name: Install ansible
pip:
name: ansible
version: "{{ ansible_pip_version }}"
extra_args: --upgrade
virtualenv: "{{ ansible_venv|default(omit) }}"
virtualenv_site_packages: "{{ ansible_venv_site_packages|default(omit) }}"
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
when:
- ansible_venv is defined
- name: Get podman version
shell: |
podman version
buildah version
podman info --debug
buildah info --debug
conmon --version
runc --version
changed_when: false

View file

@ -5,7 +5,7 @@ set -eux
CON_TYPE="${1:-podman}"
SUDO=${ROOT:+"sudo -E"}
ANSIBLECMD=$(command -v ansible-playbook)
ANSIBLECMD=${ANSIBLECMD:-$(command -v ansible-playbook)}
echo "Testing $CON_TYPE connection ${ROOT:+'with root'}"
if [[ "$CON_TYPE" == "podman" ]]; then