mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Add ansible-lint to CI (#1181)
* Improve Ansible code. * Add some ansible-lint ignores. * Add ansible-lint to CI.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Get OS version
|
||||
ansible.builtin.shell: uname -r
|
||||
ansible.builtin.command: uname -r
|
||||
register: os_version
|
||||
|
||||
- name: Install pre-reqs
|
||||
@@ -35,7 +35,7 @@
|
||||
name: Add Docker repo on Ubuntu 20 or before, or Debian 11 or before
|
||||
block:
|
||||
- name: Add gpg key
|
||||
ansible.builtin.shell: curl -fsSL https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg >key && apt-key add key
|
||||
ansible.builtin.shell: curl -fsSL https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg >key && apt-key add key # noqa: command-instead-of-module
|
||||
|
||||
- name: Add Docker repo
|
||||
ansible.builtin.apt_repository:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
file: docker-ce
|
||||
name: docker-ce-stable
|
||||
description: Docker CE Stable - $basearch
|
||||
baseurl: https://download.docker.com/linux/fedora/{{ 31 if ansible_facts.distribution_major_version|int > 31 else '$releasever' }}/$basearch/stable
|
||||
baseurl: https://download.docker.com/linux/fedora/{{ 31 if ansible_facts.distribution_major_version | int > 31 else '$releasever' }}/$basearch/stable
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
gpgkey: https://download.docker.com/linux/centos/gpg
|
||||
|
||||
- name: Update cache
|
||||
ansible.builtin.command: yum -y makecache fast
|
||||
ansible.builtin.command: yum -y makecache fast # noqa: command-instead-of-module
|
||||
|
||||
- name: Install docker
|
||||
ansible.builtin.dnf:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
needs_docker_daemon: '{{ not ansible_module_running_in_container }}'
|
||||
|
||||
- name:
|
||||
- name: Print information
|
||||
ansible.builtin.debug:
|
||||
msg: |-
|
||||
OS family: {{ ansible_facts.os_family }}
|
||||
|
||||
Reference in New Issue
Block a user