mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
- name: Install role from Galaxy (should not fail with AttributeError)
|
|
command: ansible-galaxy role install ansible.nope -vvvv --ignore-errors
|
|
|
|
- name: Archive directories
|
|
file:
|
|
state: directory
|
|
path: "{{ remote_tmp_dir }}/role.d/{{item}}"
|
|
loop:
|
|
- meta
|
|
- tasks
|
|
|
|
- name: Metadata file
|
|
copy:
|
|
content: "'galaxy_info': {}"
|
|
dest: "{{ remote_tmp_dir }}/role.d/meta/main.yml"
|
|
|
|
- name: Valid files
|
|
copy:
|
|
content: ""
|
|
dest: "{{ remote_tmp_dir }}/role.d/tasks/{{item}}"
|
|
loop:
|
|
- "main.yml"
|
|
- "valid~file.yml"
|
|
|
|
- name: Valid role archive
|
|
command: "tar cf {{ remote_tmp_dir }}/valid-role.tar {{ remote_tmp_dir }}/role.d"
|
|
|
|
- name: Add invalid symlink
|
|
file:
|
|
state: link
|
|
src: "~/invalid"
|
|
dest: "{{ remote_tmp_dir }}/role.d/tasks/~invalid.yml"
|
|
force: yes
|
|
|
|
- name: Add another invalid symlink
|
|
file:
|
|
state: link
|
|
src: "/"
|
|
dest: "{{ remote_tmp_dir }}/role.d/tasks/invalid$name.yml"
|
|
|
|
- name: Valid requirements file
|
|
copy:
|
|
dest: valid-requirements.yml
|
|
content: "[{'src': '{{ remote_tmp_dir }}/valid-role.tar', 'name': 'valid-testrole'}]"
|
|
|
|
- name: Invalid role archive
|
|
command: "tar cf {{ remote_tmp_dir }}/invalid-role.tar {{ remote_tmp_dir }}/role.d"
|
|
|
|
- name: Invalid requirements file
|
|
copy:
|
|
dest: invalid-requirements.yml
|
|
content: "[{'src': '{{ remote_tmp_dir }}/invalid-role.tar', 'name': 'invalid-testrole'}]"
|
|
|
|
- name: Install valid role
|
|
command: ansible-galaxy install -r valid-requirements.yml
|
|
|
|
- name: Uninstall valid role
|
|
command: ansible-galaxy role remove valid-testrole
|
|
|
|
- name: Install invalid role
|
|
command: ansible-galaxy install -r invalid-requirements.yml
|
|
ignore_errors: yes
|
|
register: invalid
|
|
|
|
- assert:
|
|
that: "invalid.rc != 0"
|
|
|
|
- name: Uninstall invalid role
|
|
command: ansible-galaxy role remove invalid-testrole
|
|
|
|
- import_tasks: dir-traversal.yml
|
|
- import_tasks: valid-role-symlinks.yml
|