Fixing ci
* adding task names to satisfy lint * fixing requirements for test setup Change-Id: Ic7f019c5f58b456cb36c62283bf72a195d82c299
This commit is contained in:
parent
41c93a403d
commit
91f652a932
9
molecule-requirements.txt
Normal file
9
molecule-requirements.txt
Normal file
@ -0,0 +1,9 @@
|
||||
ansible
|
||||
ansi2html
|
||||
docker
|
||||
pytest
|
||||
pytest-cov
|
||||
pytest-html
|
||||
pytest-xdist
|
||||
mock
|
||||
molecule>=3.0,<3.1
|
@ -19,7 +19,8 @@
|
||||
become: true
|
||||
hosts: all
|
||||
tasks:
|
||||
- include_role:
|
||||
- name: Test ansible-role-container-registry
|
||||
include_role:
|
||||
name: ansible-role-container-registry
|
||||
vars:
|
||||
container_registry_deploy_docker: true
|
||||
|
@ -27,7 +27,8 @@
|
||||
|
||||
- name: ensure role fails when credentials missing
|
||||
block:
|
||||
- include_role:
|
||||
- name: ensure role fails when credentials missing
|
||||
include_role:
|
||||
name: ansible-role-container-registry
|
||||
tasks_from: registry-login
|
||||
vars:
|
||||
@ -130,7 +131,8 @@
|
||||
localhost:5000:
|
||||
testuser: testpassword
|
||||
tasks:
|
||||
- include_role:
|
||||
- name: include container registry role
|
||||
include_role:
|
||||
name: ansible-role-container-registry
|
||||
tasks_from: registry-login
|
||||
|
||||
@ -149,7 +151,8 @@
|
||||
success_msg: Credential file correctly present
|
||||
failed_when: false
|
||||
rescue:
|
||||
- debug:
|
||||
- name: rescue
|
||||
debug:
|
||||
msg: noop
|
||||
|
||||
- name: Verify credentials can be used
|
||||
|
@ -33,7 +33,8 @@
|
||||
when:
|
||||
- ansible_user_dir is undefined
|
||||
|
||||
- include_role:
|
||||
- name: include container registry role
|
||||
include_role:
|
||||
name: ansible-role-container-registry
|
||||
tasks_from: docker
|
||||
|
||||
|
@ -10,7 +10,8 @@
|
||||
- container_registry_docker_install is defined
|
||||
- container_registry_docker_install is changed
|
||||
rescue:
|
||||
- debug:
|
||||
- name: Failed removing docker
|
||||
debug:
|
||||
msg: "unable to remove docker"
|
||||
become: true
|
||||
|
||||
|
@ -20,7 +20,8 @@
|
||||
loop: "{{ query('dict', container_registry_logins | default({})) }}"
|
||||
register: registry_login_docker
|
||||
rescue:
|
||||
- debug:
|
||||
- name: Failed login
|
||||
debug:
|
||||
msg: "Warning: login failed for some credentials while using docker login"
|
||||
|
||||
- import_tasks: cleanup-engine.yml
|
||||
|
@ -1,18 +1,6 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
vars:
|
||||
molecule_requirements:
|
||||
- ansible
|
||||
- ansi2html
|
||||
- docker
|
||||
- pytest
|
||||
- pytest-cov
|
||||
- pytest-html
|
||||
- pytest-xdist
|
||||
- mock
|
||||
- molecule>=3.0.1
|
||||
|
||||
tasks:
|
||||
- name: set basic user fact
|
||||
fail:
|
||||
@ -30,6 +18,10 @@
|
||||
when:
|
||||
- ansible_user_dir is undefined
|
||||
|
||||
- name: Set project path fact
|
||||
set_fact:
|
||||
container_registry_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ansible-role-container-registry'].src_dir }}"
|
||||
|
||||
- name: Ensure the user has a .ssh directory
|
||||
file:
|
||||
path: "{{ ansible_user_dir }}/.ssh"
|
||||
@ -90,8 +82,16 @@
|
||||
become: true
|
||||
when: python_v == "py2"
|
||||
|
||||
- name: Setup test-python
|
||||
- name: Ensure pbr available
|
||||
pip:
|
||||
name: "{{ molecule_requirements }}"
|
||||
name: pbr
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
|
||||
- name: Setup test-python
|
||||
pip:
|
||||
requirements: "{{ container_registry_project_path }}/molecule-requirements.txt"
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
extra_args: >-
|
||||
--constraint "{{ container_registry_project_path }}/ansible-requirements.txt"
|
||||
|
Loading…
Reference in New Issue
Block a user