Remove unused containers from molecule test
These containers aren't used, so we can remove them. That also allows us to remove all the docker prep. We also adjust the ansible-role-requirements file to make use of any zuul-provided sources to ensure that depends-on works. Depends-On: https://review.opendev.org/727968 Change-Id: I302c27f7680c3c8c04c71760bdaf3728ef1208fb
This commit is contained in:
parent
8e91b1b053
commit
39f8ef218a
@ -20,18 +20,6 @@
|
||||
gather_facts: true
|
||||
|
||||
pre_tasks:
|
||||
- name: Check for docker cli
|
||||
command: "command -v docker"
|
||||
register: docker_cli
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: Check for docker connection
|
||||
command: "docker ps"
|
||||
register: docker_ps
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: set basic user fact
|
||||
set_fact:
|
||||
ansible_user: "{{ lookup('env', 'USER') }}"
|
||||
@ -52,33 +40,3 @@
|
||||
|
||||
roles:
|
||||
- role: test_deps
|
||||
- role: ensure-docker
|
||||
when:
|
||||
- (docker_cli.rc != 0) or
|
||||
(docker_ps.rc != 0)
|
||||
|
||||
post_tasks:
|
||||
- name: Install docker-sdk
|
||||
pip:
|
||||
name: docker
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
|
||||
- name: pull an image
|
||||
docker_image:
|
||||
name: fedora:28
|
||||
source: pull
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python"
|
||||
|
||||
- name: Create a data container
|
||||
docker_container:
|
||||
name: "{{ item }}"
|
||||
image: fedora:28
|
||||
detach: true
|
||||
command: sleep 1d
|
||||
with_items:
|
||||
- docker-container1
|
||||
- docker-container2
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python"
|
||||
|
@ -39,6 +39,10 @@
|
||||
- zuul.d/playbooks/run.yml
|
||||
timeout: 1800
|
||||
voting: true
|
||||
required-projects:
|
||||
- name: openstack/ansible-role-openstack-operations
|
||||
- name: openstack/ansible-config_template
|
||||
- name: openstack/tripleo-ansible
|
||||
|
||||
- job:
|
||||
files:
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
pre_tasks:
|
||||
tasks:
|
||||
- name: Set project path fact
|
||||
set_fact:
|
||||
tripleo_upgrade_project_path: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
|
||||
@ -36,7 +36,17 @@
|
||||
requirements: "{{ tripleo_upgrade_project_path }}/molecule/molecule-requirements.txt"
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
tasks:
|
||||
|
||||
- name: Change role requirements to use zuul sources, if any are available
|
||||
shell: |-
|
||||
base_dir="{{ tripleo_upgrade_project_path.split('/')[:-3] | join('/') }}"
|
||||
for d in $(find ${base_dir} -mindepth 3 -maxdepth 3 -printf '%P\n' -type d); do
|
||||
sed -i "s|https://${d}|file:///${base_dir}/${d}|" molecule/ansible-role-requirements.yml
|
||||
done
|
||||
args:
|
||||
chdir: "{{ tripleo_upgrade_project_path }}"
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Get Ansible Galaxy roles
|
||||
command: >-
|
||||
{{ ansible_user_dir }}/test-python/bin/ansible-galaxy install
|
||||
@ -50,21 +60,3 @@
|
||||
{{ ansible_user_dir }}/test-python/bin/ansible-galaxy list
|
||||
environment:
|
||||
ANSIBLE_ROLES_PATH: "{{ tripleo_upgrade_project_path }}/molecule/roles.galaxy"
|
||||
|
||||
roles:
|
||||
- role: ensure-docker
|
||||
post_tasks:
|
||||
- name: Run docker vfs setup
|
||||
shell: |-
|
||||
. {{ ansible_user_dir }}/test-python/bin/activate
|
||||
. {{ tripleo_upgrade_project_path }}/molecule/ansible-test-env.rc
|
||||
ansible-playbook -i 'localhost,' \
|
||||
-e tripleo_docker_enable_vfs={{ tripleo_docker_enable_vfs }} \
|
||||
docker-vfs-setup.yml
|
||||
args:
|
||||
chdir: "{{ tripleo_upgrade_project_path }}/playbooks"
|
||||
executable: /bin/bash
|
||||
environment:
|
||||
ANSIBLE_ACTION_PLUGINS: "{{ tripleo_action_plugins_paths | join(':') }}"
|
||||
when:
|
||||
- tripleo_docker_enable_vfs is defined
|
||||
|
Loading…
Reference in New Issue
Block a user