Fix fetch integration test. (#75661)

pull/75679/head
Matt Clay 3 years ago committed by GitHub
parent 12734fa21c
commit 8d84f3c593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,12 +8,19 @@
paths:
- "{{ role_path }}/vars"
- name: Work-around for locked users on Alpine
# see https://github.com/ansible/ansible/issues/68676
set_fact:
password: '*'
when: ansible_distribution == 'Alpine'
- name: Create test user
user:
name: fetcher
create_home: yes
groups: "{{ _fetch_additional_groups | default(omit) }}"
append: "{{ True if _fetch_additional_groups else False }}"
password: "{{ password | default(omit) }}"
become: yes
notify:
- remove test user

@ -11,6 +11,7 @@
# and the fact that contains the path are needed in a separate ansible-playbook run.
setup_remote_tmp_dir_skip_cleanup: yes
setup_remote_tmp_dir_cache_path: yes
skip_cleanup: yes
# This prevents ssh access. It is fixed in some container images but not all.
# https://github.com/ansible/distro-test-containers/pull/70

@ -6,6 +6,15 @@
gather_facts: no
tasks:
- name: Check connectivity
command: whoami
register: whoami
- name: Verify user
assert:
that:
- whoami.stdout == 'fetcher'
- name: Try to fetch a file inside an inaccessible directory
fetch:
src: "{{ remote_tmp_dir }}/noaccess/file1"

Loading…
Cancel
Save