ansible/test/integration/targets/remote_tmp/playbook.yml
Sam Doran 775d6e6752
[stable-2.10] Changes required for macOS 10.15 (#71841) (#71954)
* Use default group of staff on macos to prevent sudo issues
* Install gnu-tar for macos in git and unarchive tests
* Enable timezone module to support py3 on macos
* If the virtualenv command is missing, try python -m virtualenv
* Install passlib for filter_core on macos
* Install paramiko via pip on macos for paramiko tests
* Normalize discovered python interpreter on macos
* Get pip tests passing, by ensuring we have wheel installed
* Create /etc/ansible for ca certs on mac, list lookup_url as destructive
* Fixups for CA certs
* Include macos
* Dynamically get cafile instead of hardcoding the path
(cherry picked from commit 35b0fef536)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-10-23 15:18:24 -05:00

57 lines
1.4 KiB
YAML

- name: Test temp dir on de escalation
hosts: testhost
become: yes
tasks:
- name: create test user
user:
name: tmptest
state: present
group: '{{ "staff" if ansible_facts.distribution == "MacOSX" else omit }}'
- name: execute test case
become_user: tmptest
block:
- name: Test case from issue 41340
blockinfile:
create: yes
block: |
export foo=bar
marker: "# {mark} Here there be a marker"
dest: /tmp/testing.txt
mode: 0644
always:
- name: clean up file
file: path=/tmp/testing.txt state=absent
- name: clean up test user
user: name=tmptest state=absent
become_user: root
- name: Test tempdir is removed
hosts: testhost
gather_facts: false
tasks:
- file:
state: touch
path: "{{ output_dir }}/65393"
- copy:
src: "{{ output_dir }}/65393"
dest: "{{ output_dir }}/65393.2"
remote_src: true
- find:
path: "~/.ansible/tmp"
use_regex: yes
patterns: 'AnsiballZ_.+\.py'
recurse: true
register: result
- debug:
var: result
- assert:
that:
# Should only be AnsiballZ_find.py because find is actively running
- result.files|length == 1
- result.files[0].path.endswith('/AnsiballZ_find.py')