diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..4778564 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - '306' diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..96b4938 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms +--- +github: geerlingguy +patreon: geerlingguy diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..c7ff127 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,56 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 90 + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 30 + +# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) +onlyLabels: [] + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - pinned + - security + - planned + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Set to true to ignore issues with an assignee (defaults to false) +exemptAssignees: false + +# Label to use when marking as stale +staleLabel: stale + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +pulls: + markComment: |- + This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution! + + Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale. + + unmarkComment: >- + This pull request is no longer marked for closure. + + closeComment: >- + This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details. + +issues: + markComment: |- + This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! + + Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale. + + unmarkComment: >- + This issue is no longer marked for closure. + + closeComment: >- + This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. diff --git a/.travis.yml b/.travis.yml index a8851b7..a0001c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,16 +6,16 @@ env: global: - ROLE_NAME: docker matrix: + - MOLECULE_DISTRO: centos8 - MOLECULE_DISTRO: centos7 - MOLECULE_DISTRO: ubuntu1804 - MOLECULE_DISTRO: ubuntu1604 - - MOLECULE_DISTRO: ubuntu1404 + - MOLECULE_DISTRO: debian10 - MOLECULE_DISTRO: debian9 - - MOLECULE_DISTRO: fedora27 install: # Install test dependencies. - - pip install molecule docker + - pip install molecule yamllint ansible-lint docker before_script: # Use actual Ansible Galaxy role name for the project directory. diff --git a/molecule/default/yaml-lint.yml b/.yamllint similarity index 100% rename from molecule/default/yaml-lint.yml rename to .yamllint diff --git a/README.md b/README.md index 390e3ce..bbd8c12 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Docker Compose installation options. (Used only for Debian/Ubuntu.) You can switch the channel to `edge` if you want to use the Edge release. docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo - docker_yum_repo_enable_edge: 0 - docker_yum_repo_enable_test: 0 + docker_yum_repo_enable_edge: '0' + docker_yum_repo_enable_test: '0' docker_yum_gpg_key: https://download.docker.com/linux/centos/gpg (Used only for RedHat/CentOS.) You can enable the Edge or Test repo by setting the respective vars to `1`. diff --git a/defaults/main.yml b/defaults/main.yml index 74b1770..7fba2ba 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,8 +23,8 @@ docker_apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg # Used only for RedHat/CentOS/Fedora. docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo -docker_yum_repo_enable_edge: 0 -docker_yum_repo_enable_test: 0 +docker_yum_repo_enable_edge: '0' +docker_yum_repo_enable_test: '0' docker_yum_gpg_key: https://download.docker.com/linux/centos/gpg # A list of users who will be added to the docker group. diff --git a/meta/main.yml b/meta/main.yml index 0dfa4cd..82065cd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -10,18 +10,17 @@ galaxy_info: platforms: - name: EL versions: - - 6 - 7 + - 8 - name: Fedora versions: - all - name: Debian versions: - - jessie - stretch + - buster - name: Ubuntu versions: - - trusty - xenial - bionic galaxy_tags: diff --git a/molecule/default/playbook.yml b/molecule/default/converge.yml similarity index 100% rename from molecule/default/playbook.yml rename to molecule/default/converge.yml diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 2ca6fea..2da47dd 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,10 +3,10 @@ dependency: name: galaxy driver: name: docker -lint: - name: yamllint - options: - config-file: molecule/default/yaml-lint.yml +lint: | + set -e + yamllint . + ansible-lint platforms: - name: instance image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" @@ -17,13 +17,5 @@ platforms: pre_build_image: true provisioner: name: ansible - lint: - name: ansible-lint playbooks: - converge: ${MOLECULE_PLAYBOOK:-playbook.yml} -scenario: - name: default -verifier: - name: testinfra - lint: - name: flake8 + converge: ${MOLECULE_PLAYBOOK:-converge.yml} diff --git a/tasks/docker-1809-shim.yml b/tasks/docker-1809-shim.yml deleted file mode 100644 index 286254b..0000000 --- a/tasks/docker-1809-shim.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Ensure containerd service dir exists. - file: - path: /etc/systemd/system/containerd.service.d - state: directory - -- name: Add shim to ensure Docker can start in all environments. - template: - src: override.conf.j2 - dest: /etc/systemd/system/containerd.service.d/override.conf - register: override_template - -- name: Reload systemd daemon if template is changed. - systemd: - daemon_reload: true - when: override_template is changed diff --git a/tasks/main.yml b/tasks/main.yml index 8968c77..56449ef 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,10 +11,6 @@ state: "{{ docker_package_state }}" notify: restart docker -# TODO: Remove this shim once 18.09.1 or later is released. -- import_tasks: docker-1809-shim.yml - when: ansible_service_mgr == 'systemd' - - name: Ensure Docker is started and enabled at boot. service: name: docker diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index dfd886c..b106944 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -11,6 +11,7 @@ name: - apt-transport-https - ca-certificates + - gnupg2 state: present - name: Add Docker apt key. @@ -26,8 +27,7 @@ when: add_repository_key is failed - name: Add Docker apt key (alternative for older systems without SNI). - shell: | - set -o pipefail + shell: > curl -sSL {{ docker_apt_gpg_key }} | sudo apt-key add - args: warn: false diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index bbeeda4..800c0bc 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -33,3 +33,9 @@ section: 'docker-{{ docker_edition }}-test' option: enabled value: '{{ docker_yum_repo_enable_test }}' + +- name: Install containerd separately (CentOS 8). + package: + name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm + state: present + when: ansible_distribution_major_version | int == 8 diff --git a/templates/override.conf.j2 b/templates/override.conf.j2 deleted file mode 100644 index adab53c..0000000 --- a/templates/override.conf.j2 +++ /dev/null @@ -1,3 +0,0 @@ -# {{ ansible_managed }} -[Service] -ExecStartPre=