ansible/test/integration/targets/fetch/roles/fetch_tests/tasks/setup.yml
Sam Doran be0cdc0ea2
deprecate _remote_checksum() and remove use in fetch (#74848)
* Remove use of _remote_checksum from fetch module
* Add deprecation message displayed during runtime
* Increase test coverage for fetch
* Add tests covering the use of stat from the fetch module

    This required creating an unpriveleged user account and connecting as that user remotely since
    it is not possible to create a file that the root user cannot stat.

* Use fact caching to persist remote tmp dir across playbook runs
* Add variables to setup_remote_tmp test role to allow caching of the remote temp dir fact
  and preventing removal of the remote_tmp_dir
2021-06-16 13:51:07 -04:00

39 lines
912 B
YAML

- name: Include system specific variables
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts.system }}.yml"
- default.yml
paths:
- "{{ role_path }}/vars"
- name: Create test user
user:
name: fetcher
create_home: yes
groups: "{{ _fetch_additional_groups | default(omit) }}"
append: "{{ True if _fetch_additional_groups else False }}"
become: yes
notify:
- remove test user
- name: Create a file that we can use to fetch
copy:
content: "test"
dest: "{{ remote_tmp_dir }}/orig"
- name: Create symlink to a file that we can fetch
file:
path: "{{ remote_tmp_dir }}/link"
src: "{{ remote_tmp_dir }}/orig"
state: "link"
- name: Create an inaccessible directory
file:
path: "{{ remote_tmp_dir }}/noaccess"
state: directory
mode: '0600'
owner: root
become: yes