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
37 changes: 18 additions & 19 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ pr:
- stable-*

schedules:
- cron: 0 9 * * *
- cron: "0 9 * * *"
displayName: Nightly
always: true
branches:
include:
- main
- cron: 0 12 * * 0
- cron: "0 12 * * 0"
displayName: Weekly (old stable branches)
always: true
branches:
Expand All @@ -51,8 +51,7 @@ resources:
pool: Standard

stages:

### Sanity & units
### Sanity & units
- stage: Ansible_devel
displayName: Sanity & Units devel
dependsOn: []
Expand All @@ -61,11 +60,11 @@ stages:
parameters:
targets:
- name: Sanity
test: 'devel/sanity/1'
test: devel/sanity/1
- name: Sanity Extra # Only on devel
test: 'devel/sanity/extra'
test: devel/sanity/extra
- name: Units
test: 'devel/units/1'
test: devel/units/1
- stage: Ansible_2_16
displayName: Sanity & Units 2.16
dependsOn: []
Expand All @@ -74,9 +73,9 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.16/sanity/1'
test: 2.16/sanity/1
- name: Units
test: '2.16/units/1'
test: 2.16/units/1
- stage: Ansible_2_15
displayName: Sanity & Units 2.15
dependsOn: []
Expand All @@ -85,9 +84,9 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.15/sanity/1'
test: 2.15/sanity/1
- name: Units
test: '2.15/units/1'
test: 2.15/units/1
- stage: Ansible_2_14
displayName: Sanity & Units 2.14
dependsOn: []
Expand All @@ -96,11 +95,11 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.14/sanity/1'
test: 2.14/sanity/1
- name: Units
test: '2.14/units/1'
test: 2.14/units/1

### Docker
### Docker
- stage: Docker_devel
displayName: Docker devel
dependsOn: []
Expand Down Expand Up @@ -164,7 +163,7 @@ stages:
- 4
- 5

### Community Docker
### Community Docker
- stage: Docker_community_devel
displayName: Docker (community images) devel
dependsOn: []
Expand All @@ -183,7 +182,7 @@ stages:
- 4
- 5

### Remote
### Remote
- stage: Remote_devel
displayName: Remote devel
dependsOn: []
Expand All @@ -194,9 +193,9 @@ stages:
targets:
- name: RHEL 9.2 with latest Docker SDK from PyPi
test: rhel/9.2-pypi-latest
# Currently always hangs in group 2
# - name: RHEL 8.8
# test: rhel/8.8
# Currently always hangs in group 2
# - name: RHEL 8.8
# test: rhel/8.8
groups:
- 1
- 2
Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
edit_on_github:
repository: ansible-collections/community.docker
branch: main
path_prefix: ''
path_prefix: ""

extra_links:
- description: Submit a bug report
Expand All @@ -17,11 +17,11 @@ extra_links:
communication:
matrix_rooms:
- topic: General usage and support questions
room: '#users:ansible.im'
room: "#users:ansible.im"
irc_channels:
- topic: General usage and support questions
network: Libera
channel: '#ansible'
channel: "#ansible"
mailing_lists:
- topic: Ansible Project List
url: https://groups.google.com/g/ansible-project
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ repository: https://github.com/ansible-collections/community.docker
homepage: https://github.com/ansible-collections/community.docker
issues: https://github.com/ansible-collections/community.docker/issues
build_ignore:
# https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#ignoring-files-and-folders
# https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#ignoring-files-and-folders
- .gitignore
- changelogs/.plugin-cache.yaml
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

requires_ansible: '>=2.11.0'
requires_ansible: ">=2.11.0"
action_groups:
docker:
- docker_compose
Expand Down
2 changes: 1 addition & 1 deletion tests/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# See template for more information:
# https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/config/config.yml
modules:
python_requires: '>= 2.7'
python_requires: ">= 2.7"
8 changes: 4 additions & 4 deletions tests/integration/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

collections:
- ansible.posix
- community.internal_test_tools
- community.crypto
- community.general
- ansible.posix
- community.internal_test_tools
- community.crypto
- community.general
76 changes: 38 additions & 38 deletions tests/integration/targets/connection/test_connection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
serial: 1
tasks:

### raw with unicode arg and output

- name: raw with unicode arg and output
raw: echo 汉语
register: command
- name: check output of raw with unicode arg and output
assert:
that:
- "'汉语' in command.stdout"
- command is changed # as of 2.2, raw should default to changed: true for consistency w/ shell/command/script modules

### copy local file with unicode filename and content

- name: create local file with unicode filename and content
local_action: lineinfile dest={{ local_tmp }}-汉语/汉语.txt create=true line=汉语
- name: remove remote file with unicode filename and content
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语/汉语.txt state=absent"
- name: create remote directory with unicode name
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语 state=directory"
- name: copy local file with unicode filename and content
action: "{{ action_prefix }}copy src={{ local_tmp }}-汉语/汉语.txt dest={{ remote_tmp }}-汉语/汉语.txt"

### fetch remote file with unicode filename and content

- name: remove local file with unicode filename and content
local_action: file path={{ local_tmp }}-汉语/汉语.txt state=absent
- name: fetch remote file with unicode filename and content
fetch: src={{ remote_tmp }}-汉语/汉语.txt dest={{ local_tmp }}-汉语/汉语.txt fail_on_missing=true validate_checksum=true flat=true

### remove local and remote temp files

- name: remove local temp file
local_action: file path={{ local_tmp }}-汉语 state=absent
- name: remove remote temp file
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语 state=absent"

### test wait_for_connection plugin
- ansible.builtin.wait_for_connection:
### raw with unicode arg and output

- name: raw with unicode arg and output
raw: echo 汉语
register: command
- name: check output of raw with unicode arg and output
assert:
that:
- "'汉语' in command.stdout"
- command is changed # as of 2.2, raw should default to changed: true for consistency w/ shell/command/script modules

### copy local file with unicode filename and content

- name: create local file with unicode filename and content
local_action: lineinfile dest={{ local_tmp }}-汉语/汉语.txt create=true line=汉语
- name: remove remote file with unicode filename and content
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语/汉语.txt state=absent"
- name: create remote directory with unicode name
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语 state=directory"
- name: copy local file with unicode filename and content
action: "{{ action_prefix }}copy src={{ local_tmp }}-汉语/汉语.txt dest={{ remote_tmp }}-汉语/汉语.txt"

### fetch remote file with unicode filename and content

- name: remove local file with unicode filename and content
local_action: file path={{ local_tmp }}-汉语/汉语.txt state=absent
- name: fetch remote file with unicode filename and content
fetch: src={{ remote_tmp }}-汉语/汉语.txt dest={{ local_tmp }}-汉语/汉语.txt fail_on_missing=true validate_checksum=true flat=true

### remove local and remote temp files

- name: remove local temp file
local_action: file path={{ local_tmp }}-汉语 state=absent
- name: remove remote temp file
action: "{{ action_prefix }}file path={{ remote_tmp }}-汉语 state=absent"

### test wait_for_connection plugin
- ansible.builtin.wait_for_connection:
12 changes: 6 additions & 6 deletions tests/integration/targets/current_container_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
current_container_facts:
register: result

# WARNING: This is not a proper test as it won't fail when the module does not work!
# To make this a proper test, we need to know the environment in which this
# test runs, which we do not know in general...
# WARNING: This is not a proper test as it won't fail when the module does not work!
# To make this a proper test, we need to know the environment in which this
# test runs, which we do not know in general...

- name: Print facts
ansible.builtin.debug:
var: result.ansible_facts

- name: Read files
ansible.builtin.slurp:
src: '{{ item }}'
src: "{{ item }}"
loop:
- /proc/self/cgroup
- /proc/self/cpuset
Expand All @@ -35,7 +35,7 @@
msg: |-
{{ item.content | ansible.builtin.b64decode | split('
') }}
loop: '{{ slurp.results }}'
loop: "{{ slurp.results }}"
loop_control:
label: '{{ item.source | default(item.item) }}'
label: "{{ item.source | default(item.item) }}"
when: item is not failed
41 changes: 21 additions & 20 deletions tests/integration/targets/docker_compose/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,33 @@
dnetworks: []

- debug:
msg: "Using container name prefix {{ cname_prefix }}"
msg: Using container name prefix {{ cname_prefix }}

# Run the tests
- block:
- include_tasks: run-test.yml
with_fileglob:
- "tests/*.yml"
- include_tasks: run-test.yml
with_fileglob:
- tests/*.yml

always:
- name: "Make sure all containers are removed"
docker_container:
name: "{{ item }}"
state: absent
force_kill: true
with_items: "{{ cnames }}"
diff: false
- name: "Make sure all networks are removed"
docker_network:
name: "{{ item }}"
state: absent
force: true
with_items: "{{ dnetworks }}"
when: docker_py_version is version('1.10.0', '>=')
diff: false
- name: Make sure all containers are removed
docker_container:
name: "{{ item }}"
state: absent
force_kill: true
with_items: "{{ cnames }}"
diff: false
- name: Make sure all networks are removed
docker_network:
name: "{{ item }}"
state: absent
force: true
with_items: "{{ dnetworks }}"
when: docker_py_version is version('1.10.0', '>=')
diff: false

when: has_docker_compose and docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.25', '>=')

- fail: msg="Too old docker / docker-py version to run all docker_container tests!"
when: has_docker_compose and not(docker_py_version is version('3.5.0', '>=') and docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6)
when: has_docker_compose and not(docker_py_version is version('3.5.0', '>=') and docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS'
or ansible_distribution_major_version|int > 6)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: "Loading tasks from {{ item }}"
- name: Loading tasks from {{ item }}
include_tasks: "{{ item }}"
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@

- assert:
that:
- "env_sleep_cmd is in (env_file_outputs.results[0].services[cname_1][cname_1_name].cmd | join(' '))"
- "new_env_sleep_cmd is in (env_file_outputs.results[1].services[cname_1][cname_1_name].cmd | join(' '))"
- env_sleep_cmd is in (env_file_outputs.results[0].services[cname_1][cname_1_name].cmd | join(' '))
- new_env_sleep_cmd is in (env_file_outputs.results[1].services[cname_1][cname_1_name].cmd | join(' '))
vars:
cname_1_name: "{{ pname + '_' + cname_1 + '_1' }}"
cname_2_name: "{{ pname + '_' + cname_2 + '_1' }}"
Expand Down
Loading