1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Clean up use of connection: local in tests.

This commit is contained in:
Matt Clay 2019-04-29 16:27:34 -07:00
parent e105f5b436
commit f6fbfeace8
9 changed files with 19 additions and 29 deletions

View file

@ -3,7 +3,7 @@
- name: Create a local temporary directory - name: Create a local temporary directory
shell: mktemp -d /tmp/ansible_test.XXXXXXXXX shell: mktemp -d /tmp/ansible_test.XXXXXXXXX
register: tempfile_result register: tempfile_result
connection: local delegate_to: localhost
- set_fact: - set_fact:
local_temp_dir: '{{ tempfile_result.stdout }}' local_temp_dir: '{{ tempfile_result.stdout }}'
@ -66,13 +66,13 @@
file: file:
path: '{{ local_temp_dir }}' path: '{{ local_temp_dir }}'
state: absent state: absent
connection: local delegate_to: localhost
- name: Remove symbolic link - name: Remove symbolic link
file: file:
path: '{{ role_path }}/files/subdir/subdir1/{{ item.key }}' path: '{{ role_path }}/files/subdir/subdir1/{{ item.key }}'
state: absent state: absent
connection: local delegate_to: localhost
with_dict: "{{ symlinks }}" with_dict: "{{ symlinks }}"
- name: Remote unprivileged remote user - name: Remote unprivileged remote user

View file

@ -384,7 +384,7 @@
content: "foo.txt\n" content: "foo.txt\n"
dest: '{{ local_temp_dir }}/foo.txt' dest: '{{ local_temp_dir }}/foo.txt'
mode: 0547 mode: 0547
connection: local delegate_to: localhost
- name: Copy with mode=preserve - name: Copy with mode=preserve
copy: copy:
@ -435,7 +435,7 @@
file: file:
path: '{{ role_path }}/files/subdir/subdira' path: '{{ role_path }}/files/subdir/subdira'
state: directory state: directory
connection: local delegate_to: localhost
- name: Set the output subdirectory - name: Set the output subdirectory
set_fact: set_fact:
@ -450,13 +450,13 @@
copy: copy:
dest: /tmp/ansible-test-abs-link dest: /tmp/ansible-test-abs-link
content: target content: target
connection: local delegate_to: localhost
- name: Setup link target dir for absolute link - name: Setup link target dir for absolute link
file: file:
dest: /tmp/ansible-test-abs-link-dir dest: /tmp/ansible-test-abs-link-dir
state: directory state: directory
connection: local delegate_to: localhost
- name: Test recursive copy to directory no trailing slash, local_follow=False - name: Test recursive copy to directory no trailing slash, local_follow=False
copy: copy:
@ -607,13 +607,13 @@
copy: copy:
dest: /tmp/ansible-test-abs-link dest: /tmp/ansible-test-abs-link
content: target content: target
connection: local delegate_to: localhost
- name: Setup link target dir for absolute link - name: Setup link target dir for absolute link
file: file:
dest: /tmp/ansible-test-abs-link-dir dest: /tmp/ansible-test-abs-link-dir
state: directory state: directory
connection: local delegate_to: localhost
- name: Test recursive copy to directory trailing slash, local_follow=False - name: Test recursive copy to directory trailing slash, local_follow=False
copy: copy:
@ -762,13 +762,13 @@
copy: copy:
dest: /tmp/ansible-test-abs-link dest: /tmp/ansible-test-abs-link
content: target content: target
connection: local delegate_to: localhost
- name: Setup link target dir for absolute link - name: Setup link target dir for absolute link
file: file:
dest: /tmp/ansible-test-abs-link-dir dest: /tmp/ansible-test-abs-link-dir
state: directory state: directory
connection: local delegate_to: localhost
- name: Test recursive copy to directory no trailing slash, local_follow=True - name: Test recursive copy to directory no trailing slash, local_follow=True
copy: copy:
@ -940,7 +940,7 @@
file: file:
path: '{{ local_temp_dir }}/dest1' path: '{{ local_temp_dir }}/dest1'
state: directory state: directory
connection: local delegate_to: localhost
- name: Recursive copy the source - name: Recursive copy the source
copy: copy:
@ -1003,7 +1003,7 @@
file: file:
path: '{{ local_temp_dir }}/destination' path: '{{ local_temp_dir }}/destination'
state: directory state: directory
connection: local delegate_to: localhost
- name: Copy the directory and files within (no trailing slash) - name: Copy the directory and files within (no trailing slash)
copy: copy:
@ -1383,8 +1383,7 @@
path: '{{ local_temp_dir }}/top_dir/subdir/circle' path: '{{ local_temp_dir }}/top_dir/subdir/circle'
src: '{{ local_temp_dir }}/top_dir/' src: '{{ local_temp_dir }}/top_dir/'
state: link state: link
delegate_to: localhost
connection: local
- name: Copy the directory's link - name: Copy the directory's link
copy: copy:

View file

@ -1,6 +1,5 @@
--- ---
- hosts: localhost - hosts: localhost
connection: local
gather_facts: false gather_facts: false
tasks: tasks:
- name: Hi - name: Hi

View file

@ -1,6 +1,5 @@
- name: setup state - name: setup state
hosts: testhost hosts: localhost
connection: local
gather_facts: false gather_facts: false
tasks: tasks:
- file: path={{playbook_dir}}/files state=directory - file: path={{playbook_dir}}/files state=directory
@ -42,8 +41,7 @@
play_out: in local play_out: in local
- name: cleanup - name: cleanup
hosts: testhost hosts: localhost
connection: local
gather_facts: false gather_facts: false
tasks: tasks:
- file: path={{playbook_dir}}/testfile state=absent - file: path={{playbook_dir}}/testfile state=absent

View file

@ -1,6 +1,5 @@
- name: test initial state - name: test initial state
hosts: testhost hosts: localhost
connection: local
gather_facts: false gather_facts: false
pre_tasks: pre_tasks:
- name: remove {{ remove }} - name: remove {{ remove }}

View file

@ -1,8 +1,6 @@
--- ---
- hosts: localhost - hosts: localhost
connection: local
gather_facts: no gather_facts: no
- hosts: localhost - hosts: localhost
connection: local
gather_facts: yes gather_facts: yes

View file

@ -1,5 +1,4 @@
- name: Generate privatekey1 - standard - name: Generate privatekey1 - standard
connection: local
openssh_keypair: openssh_keypair:
path: '{{ output_dir }}/privatekey1' path: '{{ output_dir }}/privatekey1'

View file

@ -1,8 +1,7 @@
--- ---
- name: verify tags work as expected - name: verify tags work as expected
hosts: localhost hosts: testhost
gather_facts: False gather_facts: False
connection: local
vars: vars:
the_tags: the_tags:
- tag3 - tag3

View file

@ -1,7 +1,6 @@
--- ---
- name: 'Test templating in name' - name: 'Test templating in name'
hosts: testhost hosts: testhost
connection: local
vars: vars:
a_list: a_list:
- 'part' - 'part'