Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible code bot recommendations #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
trigger:
batch: true
branches:
Expand All @@ -13,7 +14,7 @@ pr:
- stable-*

schedules:
- cron: 0 9 * * *
- cron: "0 9 * * *"
displayName: Nightly
always: true
branches:
Expand Down Expand Up @@ -41,8 +42,7 @@ resources:
pool: Standard

stages:

## Docker
## Docker
- stage: Docker_devel
displayName: Docker devel
dependsOn: []
Expand Down Expand Up @@ -200,7 +200,7 @@ stages:
- name: Ubuntu 18.04
test: ubuntu1804

## Remote
## Remote
- stage: Remote_devel
displayName: Remote devel
dependsOn: []
Expand Down Expand Up @@ -332,7 +332,7 @@ stages:
- name: RHEL 8.1
test: rhel/8.1

## Finally
## Finally

- stage: Summary
condition: succeededOrFailed()
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
comment: false
1 change: 1 addition & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
namespace: ansible
name: posix
version: 1.5.4
Expand Down
4 changes: 2 additions & 2 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
requires_ansible: '>=2.9'
requires_ansible: ">=2.9"
plugin_routing:
callback:
skippy:
deprecation:
removal_date: '2022-06-01'
removal_date: "2022-06-01"
warning_text: See the plugin documentation for more details
13 changes: 7 additions & 6 deletions shippable.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
language: python

env:
Expand All @@ -15,37 +16,37 @@ matrix:
- env: T=2.9/freebsd/12.0/1
- env: T=2.9/linux/centos6/1
- env: T=2.9/linux/centos7/1
# - env: T=2.9/linux/centos8/1
# - env: T=2.9/linux/centos8/1
- env: T=2.9/linux/fedora30/1
- env: T=2.9/linux/fedora31/1
- env: T=2.9/linux/opensuse15py2/1
- env: T=2.9/linux/opensuse15/1
- env: T=2.9/linux/ubuntu1604/1
- env: T=2.9/linux/ubuntu1804/1
# - env: T=2.10/aix/7.2/1
# - env: T=2.10/aix/7.2/1
- env: T=2.10/osx/10.11/1
- env: T=2.10/rhel/7.6/1
- env: T=2.10/rhel/8.2/1
- env: T=2.10/freebsd/11.1/1
- env: T=2.10/freebsd/12.1/1
- env: T=2.10/linux/centos6/1
- env: T=2.10/linux/centos7/1
# - env: T=2.10/linux/centos8/1
# - env: T=2.10/linux/centos8/1
- env: T=2.10/linux/fedora30/1
- env: T=2.10/linux/fedora31/1
- env: T=2.10/linux/opensuse15py2/1
- env: T=2.10/linux/opensuse15/1
- env: T=2.10/linux/ubuntu1604/1
- env: T=2.10/linux/ubuntu1804/1
# - env: T=devel/aix/7.2/1
# - env: T=devel/aix/7.2/1
- env: T=devel/osx/10.11/1
- env: T=devel/rhel/7.6/1
- env: T=devel/rhel/8.1/1
- env: T=devel/freebsd/11.1/1
- env: T=devel/freebsd/12.1/1
- env: T=devel/linux/centos6/1
- env: T=devel/linux/centos7/1
# - env: T=devel/linux/centos8/1
# - env: T=devel/linux/centos8/1
- env: T=devel/linux/fedora30/1
- env: T=devel/linux/fedora31/1
- env: T=devel/linux/opensuse15py2/1
Expand All @@ -56,7 +57,7 @@ matrix:
branches:
except:
- "*-patch-*"
- "revert-*-*"
- revert-*-*

build:
ci:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
collections:
- community.general
- community.general
95 changes: 47 additions & 48 deletions tests/integration/targets/acl/tasks/acl.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# (c) 2017, Martin Krizek <mkrizek@redhat.com>

# This file is part of Ansible
Expand All @@ -16,30 +17,30 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

- name: Create ansible user
user:
ansible.builtin.user:
name: "{{ test_user }}"

- name: Create ansible group
group:
ansible.builtin.group:
name: "{{ test_group }}"

- name: Clean up working directory and files
file:
ansible.builtin.file:
path: "{{ output_dir }}"
state: absent

- name: Create working directory
file:
ansible.builtin.file:
path: "{{ output_dir }}"
state: directory

- name: Create ansible file
file:
ansible.builtin.file:
path: "{{ test_file }}"
state: touch

- name: Create ansible dir
file:
ansible.builtin.file:
path: "{{ test_dir }}"
state: directory
##############################################################################
Expand All @@ -52,12 +53,12 @@
state: present
register: output

- name: get getfacl output
shell: "getfacl {{ test_file | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_file | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is changed
- output is not failed
Expand All @@ -69,12 +70,12 @@
path: "{{ test_file }}"
register: output

- name: get getfacl output
shell: "getfacl {{ test_file | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_file | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is not changed
- output is not failed
Expand All @@ -97,12 +98,12 @@
state: absent
register: output

- name: get getfacl output
shell: "getfacl {{ test_file | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_file | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is changed
- output is not failed
Expand All @@ -115,39 +116,38 @@
entity: "{{ test_user }}"
etype: user
permissions: rw
default: yes
default: true
state: present
register: output

- name: get getfacl output
shell: "getfacl {{ test_dir | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_dir | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is changed
- output is not failed
- "'user:{{ test_user }}:rw-' in output.acl"
- "'default:user:{{ test_user }}:rw-' in getfacl_output.stdout_lines"
##############################################################################
- name: Cleanup
shell: "setfacl -b {{ test_dir | quote }}"
##############################################################################
ansible.builtin.command: setfacl -b {{ test_dir | quote }}
- name: Same as previous but using entry shorthand
acl:
path: "{{ test_dir }}"
entry: "user:{{ test_user }}:rw-"
default: yes
entry: user:{{ test_user }}:rw-
default: true
state: present
register: output

- name: get getfacl output
shell: "getfacl {{ test_dir | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_dir | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is changed
- output is not failed
Expand All @@ -157,50 +157,49 @@
- name: Same as previous, to test idempotence
acl:
path: "{{ test_dir }}"
entry: "user:{{ test_user }}:rw-"
default: yes
entry: user:{{ test_user }}:rw-
default: true
state: present
register: output

- name: get getfacl output
shell: "getfacl {{ test_dir | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_dir | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is not changed
- output is not failed
- "'user:{{ test_user }}:rw-' in output.acl"
- "'default:user:{{ test_user }}:rw-' in getfacl_output.stdout_lines"
##############################################################################
- name: Cleanup
shell: "setfacl -b {{ test_dir | quote }}"
##############################################################################
ansible.builtin.command: setfacl -b {{ test_dir | quote }}
- name: Set default acls
acl:
path: "{{ test_dir }}"
entry: "{{ item }}"
default: yes
default: true
state: present
with_items:
- "user:{{ test_user }}:rw-"
- "group:{{ test_group }}:rw-"
- user:{{ test_user }}:rw-
- group:{{ test_group }}:rw-

- name: Remove default group test_user acl
acl:
path: "{{ test_dir }}"
entry: "group:{{ test_group }}:rw-"
default: yes
entry: group:{{ test_group }}:rw-
default: true
state: absent
register: output

- name: get getfacl output
shell: "getfacl {{ test_dir | quote }}"
- name: Get getfacl output
ansible.builtin.command: getfacl {{ test_dir | quote }}
register: getfacl_output

- name: verify output
assert:
- name: Verify output
ansible.builtin.assert:
that:
- output is changed
- output is not failed
Expand Down
17 changes: 9 additions & 8 deletions tests/integration/targets/acl/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# (c) 2017, Martin Krizek <mkrizek@redhat.com>

# This file is part of Ansible
Expand All @@ -17,20 +18,20 @@

- block:

- include_tasks: acl.yml
when: ansible_system == 'Linux' # TODO enable acls mount option on FreeBSD to test it there too
- ansible.builtin.include_tasks: acl.yml
when: ansible_system == 'Linux' # TODO enable acls mount option on FreeBSD to test it there too

always:
- name: delete created directory and file
file:
path: '{{ item }}'
- name: Delete created directory and file
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- '{{ test_dir }}'
- '{{ test_file }}'
- "{{ test_dir }}"
- "{{ test_file }}"

vars:
test_user: ansible_user
test_group: ansible_group
test_file: '{{ output_dir }}/ansible file'
test_file: "{{ output_dir }}/ansible file"
test_dir: "{{ output_dir }}/ansible_dir/with some space"
1 change: 1 addition & 0 deletions tests/integration/targets/at/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
dependencies:
- prepare_tests
Loading