Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsysmin committed Feb 1, 2024
1 parent 55df3b1 commit d5d3844
Show file tree
Hide file tree
Showing 48 changed files with 291 additions and 376 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: "release"
name: release
on:
release:
types:
- created
jobs:
release:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
ANSIBLE_GALAXY_TOKEN: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
ANSIBLE_FORCE_COLOR: 1
Expand Down
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .yamllint

This file was deleted.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

This role provides the following:

- Installation of Docker following Docker-Engine install procedures as documented by Docker.
- It will manage kernel versions as well, verifying the that the correct kernel for Docker support is installed.
- Installation of Docker following Docker-Engine install procedures as documented by Docker.
- It will manage kernel versions as well, verifying the that the correct kernel for Docker support is installed.

Supports the following Operating Systems:

- CentOS 7
- RedHat 7
- Fedora 24
- Fedora 23
- Fedora 26
- Fedora 27
- Fedora 29
- OracleLinux 7
- Ubuntu 14.04
- Ubuntu 16.04
- CentOS 7
- RedHat 7
- Fedora 24
- Fedora 23
- Fedora 26
- Fedora 27
- Fedora 29
- OracleLinux 7
- Ubuntu 14.04
- Ubuntu 16.04

## Requirements

Expand Down
16 changes: 8 additions & 8 deletions build/galaxy_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
tag: "{{ github_tag.split('/')[-1] }}"
pre_tasks:
- name: Ensure the ANSIBLE_GALAXY_TOKEN environment variable is set.
fail:
ansible.builtin.fail:
msg: ANSIBLE_GALAXY_TOKEN is not set.
when: "lookup('env','ANSIBLE_GALAXY_TOKEN') | length == 0"
when: lookup('env','ANSIBLE_GALAXY_TOKEN') | length == 0
- name: Ensure the ~/.ansible directory exists.
file:
ansible.builtin.file:
path: ~/.ansible
state: directory
- name: Write the Galaxy token to ~/.ansible/galaxy_token
copy:
ansible.builtin.copy:
content: |
token: {{ lookup('env','ANSIBLE_GALAXY_TOKEN') }}
token: {{ lookup('env', 'ANSIBLE_GALAXY_TOKEN') }}
dest: ~/.ansible/galaxy_token
tasks:
- name: Template out the galaxy.yml file.
template:
ansible.builtin.template:
src: templates/galaxy.yml.j2
dest: ../galaxy.yml
register: galaxy_yml
- name: Build the collection. # noqa 503
command: >
ansible.builtin.command: >
ansible-galaxy collection build
chdir=../
when: galaxy_yml.changed
- name: Publish the collection. # noqa 503
command: >
ansible.builtin.command: >
ansible-galaxy collection publish ./ericsysmin-docker-{{ tag }}.tar.gz
chdir=../
when: galaxy_yml.changed
55 changes: 8 additions & 47 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,19 @@
### REQUIRED

# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric characters and underscores. Additionally namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
---
namespace: ericsysmin

# The name of the collection. Has the same character restrictions as 'namespace'
name: docker

# The version of the collection. Must be compatible with semantic versioning
version: 0.1.1

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
version: "1.0.0"
readme: README.md

# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Eric Anderson <[email protected]>


### OPTIONAL but strongly recommended

# A short summary description of the collection
- Eric Anderson <[email protected]>
description: Docker collection

# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
# license:
# - GPL-2.0-or-later

# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: LICENSE

# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags:
- docker

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
#dependencies: {}

# The URL of the originating SCM repository
- infrastructure
dependencies: {
"community.general": "*",
"ansible.posix": "*"
}
repository: https://github.com/ericsysmin/ansible-collection-docker

# The URL to any online docs
#documentation: http://docs.example.com

# The URL to the homepage of the collection/project
homepage: https://github.com/ericsysmin/ansible-collection-docker

# The URL to the collection issue tracker
issues: https://github.com/ericsysmin/ansible-collection-docker/issues
14 changes: 8 additions & 6 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
- name: Converge
hosts: all
pre_tasks:
- name: upgrade python # noqa 403
package:
- name: Upgrade python # noqa package-latest
ansible.builtin.package:
name: python
state: latest
- name: create containerd folder
file:
- name: Create containerd folder
ansible.builtin.file:
path: /etc/systemd/system/containerd.service.d
state: directory
mode: "0644"
when: ansible_service_mgr == "systemd"
- name: override file for containerd
copy:
- name: Override file for containerd
ansible.builtin.copy:
src: files/override.conf
dest: /etc/systemd/system/containerd.service.d/override.conf
mode: "0644"
when: ansible_service_mgr == "systemd"
roles:
- role: ericsysmin.docker.docker
6 changes: 3 additions & 3 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true
- name: Example assertion
ansible.builtin.assert:
that: true
1 change: 1 addition & 0 deletions roles/docker/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# code: language=ansible
# defaults file for docker
docker_service_enabled: true
docker_config: {}
Expand Down
7 changes: 5 additions & 2 deletions roles/docker/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
- name: Docker | Daemon-reload
systemd: daemon_reload=yes
ansible.builtin.systemd:
daemon_reload: "yes"

- name: Docker | Restart Docker
service: name=docker state=restarted
ansible.builtin.service:
name: docker
state: restarted
24 changes: 2 additions & 22 deletions roles/docker/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
---
# code: language=ansible
galaxy_info:
role_name: docker
author: ericsymsin
description: Ansible role that installs Docker
company: Avi Networks
issue_tracker_url: https://github.com/ericsysmin/ansible-collection-docker/issues
license: Apache-2.0
license: MIT
min_ansible_version: 2.4.0
github_branch: master
platforms:
- name: EL
versions:
- 7
- 8
- name: Fedora
versions:
- 27
- 28
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- name: Debian
versions:
- jessie
- stretch
- wheezy
galaxy_tags:
- docker
- ubuntu
Expand Down
36 changes: 14 additions & 22 deletions roles/docker/tasks/ce/apt.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
---
- name: Docker | CE | APT | Remove old repo lxc-docker
apt:
name:
- docker
- docker-engine
- docker-io
state: absent
register: task_result
until: task_result is success
retries: 10
delay: 2

# code: language=ansible
- name: Docker | CE | APT | Install Prerequisits for APT
apt:
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
Expand All @@ -28,33 +17,36 @@
- name: Docker | CE | APT | Add repository key
block:
- name: Docker | CE | APT | Add Docker GPG Key
apt_key:
ansible.builtin.apt_key:
id: "{{ docker_ce_gpg_key_id }}"
url: "{{ docker_ce_gpg_key }}"
validate_certs: "{{ docker_ce_gpg_key_validate_certs }}"
rescue:
- name: Docker | CE | APT | Ensure curl is present (systems without SNI).
package: name=curl
- name: Docker | CE | APT | Download GPG key (systems without SNI). # noqa 303
shell: "curl -sSL {{ docker_ce_gpg_key }} | sudo apt-key add -"
ansible.builtin.package:
name: curl
- name: Docker | CE | APT | Download GPG key (systems without SNI). # noqa command-instead-of-module no-changed-when risky-shell-pipe
ansible.builtin.shell: curl -sSL {{ docker_ce_gpg_key }} | sudo apt-key add -

- name: Docker | CE | APT | Configure Docker repository
apt_repository:
ansible.builtin.apt_repository:
repo: "{{ docker_apt_repo_url }}"

- name: Docker | CE | APT | Enable Edge repository
apt_repository:
ansible.builtin.apt_repository:
repo: "{{ docker_apt_repo_url_edge }}"
when: docker_channel == "edge"

- name: Docker | CE | APT | Perform specific os tasks
include_tasks: "{{ item }}"
ansible.builtin.include_tasks: "{{ item }}"
with_first_found:
- os/{{ ansible_distribution.split(' ', 1)[0]|lower }}.yml
- os/{{ ansible_distribution.split(' ', 1)[0] | lower }}.yml
- os/default.yml

- name: Docker | CE | APT | Install docker-ce
apt: name=docker-ce state=present
ansible.builtin.apt:
name: docker-ce
state: present
notify: Docker | Restart Docker
register: task_result
until: task_result is success
Expand Down
Loading

0 comments on commit d5d3844

Please sign in to comment.