From 1606ae462f12bbb365b9f6fb1c8936740968234b Mon Sep 17 00:00:00 2001 From: Michael Buluma Date: Tue, 2 Jan 2024 19:13:25 +0300 Subject: [PATCH] Happy Newmanium 2024/Update Role. --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +-- .github/release-drafter.yml | 11 ++++---- .github/workflows/depandabot_merge.yml | 35 ++++++++++++++++++++++++++ .github/workflows/galaxy.yml | 2 +- .github/workflows/molecule.yml | 14 +++++------ .github/workflows/release_drafter.yml | 31 +++++++++++++++-------- .github/workflows/requirements2png.yml | 7 +++++- .github/workflows/todo.yml | 12 +++++++-- CONTRIBUTING.md | 13 +++++----- LICENSE | 2 +- README.md | 23 +++++++---------- SECURITY.md | 5 ++-- tox.ini | 8 +++--- 13 files changed, 108 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/depandabot_merge.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f616070..fc64712 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help me improve +about: Create a report to help me improve this role. --- @@ -20,7 +20,7 @@ YOUR PLAYBOOK HERE ## Output -Show at least the error, possible related output, maybe just all the output. +Show at least the error, possible related output, if possible all the output. ## Environment diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index f39857b..3e9b50f 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,12 +1,13 @@ --- -name-template: 'v$RESOLVED_VERSION 🌈' -tag-template: 'v$RESOLVED_VERSION' +name-template: 'v$NEXT_MINOR_VERSION' +tag-template: 'v$NEXT_MINOR_VERSION' categories: - title: 'πŸš€ Features' labels: - 'feature' - 'enhancement' - - title: 'πŸ› Bug Fixes' + - 'dependencies' + - title: 'πŸ› Role Fixes' labels: - 'fix' - 'bugfix' @@ -25,8 +26,8 @@ version-resolver: patch: labels: - 'patch' - default: patch + default: minor template: | - ## Rifle, Rifle, Rifle! + ## What’s Changed $CHANGES diff --git a/.github/workflows/depandabot_merge.yml b/.github/workflows/depandabot_merge.yml new file mode 100644 index 0000000..dd8b15d --- /dev/null +++ b/.github/workflows/depandabot_merge.yml @@ -0,0 +1,35 @@ +--- +# +# Ansible managed +# + +name: "Dependabot Merge" + +on: + pull_request: + pull_request_target: + +permissions: + contents: write + pull-requests: write + +jobs: + build: + runs-on: "ubuntu-20.04" + steps: + - uses: "actions/checkout@master" + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: "Merge Dependabot PR" + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index 0f0ec5e..7707b00 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -17,4 +17,4 @@ jobs: uses: robertdebock/galaxy-action@1.2.1 with: galaxy_api_key: ${{ secrets.galaxy_api_key }} - git_branch: main + git_branch: ${{ github.event.repository.default_branch }} diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 72e8a2a..234e1f4 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -54,9 +54,11 @@ jobs: - image: "debian-systemd" tag: "bullseye" - image: "fedora-systemd" - tag: "37" + tag: "38" - image: "fedora-systemd" tag: "latest" + - image: "fedora-systemd" + tag: "rawhide" - image: "docker-opensuse-systemd" tag: "latest" - image: "docker-ubuntu-systemd" @@ -68,16 +70,12 @@ jobs: - image: "kali" tag: "latest" steps: - - name: checkout + - name: Checkout Role uses: actions/checkout@v4 with: path: "${{ github.repository }}" - # - name: disable apparmor for mysql - # run: sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ - # - name: parse apparmor for mysql - # run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - - name: molecule - uses: buluma/molecule-action@v5.1.1 + - name: Running Molecule Test + uses: buluma/molecule-action@v6.0.0 with: image: ${{ matrix.config.image }} tag: ${{ matrix.config.tag }} diff --git a/.github/workflows/release_drafter.yml b/.github/workflows/release_drafter.yml index 753cf86..63f463e 100644 --- a/.github/workflows/release_drafter.yml +++ b/.github/workflows/release_drafter.yml @@ -7,8 +7,9 @@ name: Release Drafter on: push: - # branches to consider in the event; optional, defaults to all + # branches to consider in the event; optional, defaults to default branches: + - master - main - testing paths-ignore: @@ -19,21 +20,30 @@ on: # Only following types are handled by the action, but one can default to all as well types: [opened, reopened, synchronize] +permissions: + contents: write + concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v5 # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true + with: + config-name: release-drafter.yml + disable-autolabeler: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} changelog_draft: @@ -41,21 +51,20 @@ jobs: steps: - name: Checkout dj-wasabi-release repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: dj-wasabi/dj-wasabi-release path: dj-wasabi-release - name: Checkout current repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - path: main - + path: ${{ github.event.repository.default_branch }} - name: Commit Changelog file run: | - # We are cloned in the 'main' directory and the dj-wasabi-release - # repository is the 'dj-wasabi-release' next to 'main' - cd main + # We are cloned in the 'default' directory and the dj-wasabi-release + # repository is the 'dj-wasabi-release' next to 'default' + cd ${{ github.event.repository.default_branch }} # Generate CHANGELOG.md file ../dj-wasabi-release/release.sh -d # Let commit the changes if there are any? (Well there should be!) diff --git a/.github/workflows/requirements2png.yml b/.github/workflows/requirements2png.yml index a510c4d..9835194 100644 --- a/.github/workflows/requirements2png.yml +++ b/.github/workflows/requirements2png.yml @@ -3,11 +3,16 @@ # Ansible managed # +name: Ansible Graphviz on: push: + branches: + - master + - main paths: - '.github/workflows/requirements2png.yml' -name: Ansible Graphviz + tags_ignore: + - '*' jobs: build: diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index 7837717..faa225d 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -7,14 +7,22 @@ name: "TODO 2 Issue" on: push: + branches: + - master + - main + paths-ignore: + - '**/README.md' + - '**/CHANGELOG.md' + tags_ignore: + - '*' jobs: build: runs-on: "ubuntu-20.04" steps: - - uses: "actions/checkout@master" + - uses: "actions/checkout@v4" - name: "TODO to Issue" - uses: "alstr/todo-to-issue-action@v2.3" # TODO: Update buluma/todo-to-issue-action@v1.0.1 @buluma + uses: "buluma/todo-to-issue-action@v2.0.2" id: "todo" with: TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 204773e..6a55e82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ Here is how you can help, a lot of steps are related to GitHub, not specifically When you spot an issue, [create an issue](https://github.com/buluma/ansible-role-openssh/issues). -Making the issue help me and others to find similar problems in the future. +Raising the issue helps me and others to find similar problems and solutions in the future. ### [2. Fork the project.](#2-fork-the-project) @@ -29,7 +29,7 @@ In you own GitHub namespace, make the required changes. I typically do that by cloning the repository (in your namespace) locally: -``` +```shell git clone git@github.com:YOURNAMESPACE/ansible-role-openssh.git ``` @@ -39,19 +39,19 @@ Now you can start to edit on your laptop. Install [molecule](https://molecule.readthedocs.io/en/stable/) and [Tox](https://tox.readthedocs.io/): -``` +```shell pip install molecule tox ansible-lint docker ``` And run `molecule test`. If you want to test a specific distribution, set `image` and optionally `tag`: -``` +```shell image=centos tag=7 molecule test ``` Once it start to work, you can test multiple version of Ansible: -``` +```shell image=centos tag=7 tox ``` @@ -71,6 +71,5 @@ In the comment-box, you can [refer to the issue number](https://help.github.com/ Now I'll get a message that you've added some code. Thank you, really. -CI starts to test your changes. You can follow the progress on GitHub. +CI starts to test your changes once pull request is reviewed. You can follow the progress on GitHub. -Please consider [sponsoring me](https://github.com/sponsors/buluma). diff --git a/LICENSE b/LICENSE index 5bb4321..b1377f8 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 Shadow Walker (bulumaknight@gmail.com) + Copyright 2024 Shadow Walker (bulumaknight@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 5a4fe3c..e9b57f1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# [Ansible role openssh](#openssh) +# Ansible role [openssh](https://galaxy.ansible.com/ui/standalone/roles/buluma/openssh/documentation) Install and configure openssh on your system. -|GitHub|GitLab|Downloads|Version|Issues|Pull Requests| -|------|------|-------|-------|------|-------------| -|[![github](https://github.com/buluma/ansible-role-openssh/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-openssh/actions/workflows/molecule.yml)|[![gitlab](https://gitlab.com/shadowwalker/ansible-role-openssh/badges/master/pipeline.svg)](https://gitlab.com/shadowwalker/ansible-role-openssh)|[![downloads](https://img.shields.io/ansible/role/d/4787)](https://galaxy.ansible.com/buluma/openssh)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/releases/)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/pulls/)| +|GitHub|Version|Issues|Pull Requests|Downloads| +|------|-------|------|-------------|---------| +|[![github](https://github.com/buluma/ansible-role-openssh/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-openssh/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/releases/)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-openssh.svg)](https://github.com/buluma/ansible-role-openssh/pulls/)|[![Ansible Role](https://img.shields.io/ansible/role/d/buluma/openssh)](https://galaxy.ansible.com/ui/standalone/roles/buluma/openssh/documentation)| ## [Example Playbook](#example-playbook) @@ -164,10 +164,10 @@ openssh_trusted_user_ca_keys: none The following roles are used to prepare a system. You can prepare your system in another way. -| Requirement | GitHub | GitLab | +| Requirement | GitHub | Version | |-------------|--------|--------| -|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Build Status GitHub](https://github.com/buluma/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions)|[![Build Status GitLab](https://gitlab.com/shadowwalker/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/shadowwalker/ansible-role-bootstrap)| -|[buluma.selinux](https://galaxy.ansible.com/buluma/selinux)|[![Build Status GitHub](https://github.com/buluma/ansible-role-selinux/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-selinux/actions)|[![Build Status GitLab](https://gitlab.com/shadowwalker/ansible-role-selinux/badges/master/pipeline.svg)](https://gitlab.com/shadowwalker/ansible-role-selinux)| +|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Ansible Molecule](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-bootstrap.svg)](https://github.com/shadowwalker/ansible-role-bootstrap)| +|[buluma.selinux](https://galaxy.ansible.com/buluma/selinux)|[![Ansible Molecule](https://github.com/buluma/ansible-role-selinux/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-selinux/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-selinux.svg)](https://github.com/shadowwalker/ansible-role-selinux)| ## [Context](#context) @@ -206,14 +206,9 @@ If you find issues, please register them in [GitHub](https://github.com/buluma/a ## [License](#license) -[Apache-2.0](https://github.com/buluma/ansible-role-openssh/blob/master/LICENSE). +[Apache-2.0](https://github.com/buluma/ansible-role-openssh/blob/master/LICENSE) ## [Author Information](#author-information) -[buluma](https://buluma.github.io/) +[Shadow Walker](https://buluma.github.io/) -Please consider [sponsoring me](https://github.com/sponsors/buluma). - -### [Special Thanks](#special-thanks) - -Template inspired by [Robert de Bock](https://github.com/robertdebock) diff --git a/SECURITY.md b/SECURITY.md index a7443d5..fcb887b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,9 +8,9 @@ These version of [ansible](https://pypi.org/project/ansible/) are supported: | Version | Supported | | ------- | ------------------ | +| 9 | :white_check_mark: | +| 8 | :white_check_mark: | | 7 | :white_check_mark: | -| 6 | :white_check_mark: | -| 5 | :white_check_mark: | ## [Reporting a Vulnerability](#reporting-a-vulnarability) @@ -20,4 +20,3 @@ Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc. -Please consider [sponsoring me](https://github.com/sponsors/buluma). diff --git a/tox.ini b/tox.ini index 52387a8..075c759 100644 --- a/tox.ini +++ b/tox.ini @@ -3,19 +3,19 @@ # [tox] minversion = 4.2.4 -# Ansible 6 and 7 are disabled, causing issues with Fedora: +# Ansible 7 is disabled, causing issues with Fedora: # https://github.com/ansible/ansible/issues/81199#event-9773321055 -# envlist = py3-ansible{6,7,8} -envlist = py3-ansible{8} +# envlist = py3-ansible{7,8,9} +envlist = py3-ansible{8,9} skipsdist = true [testenv] deps = -rrequirements.txt - ansible6: ansible == 6.* ansible7: ansible == 7.* ansible8: ansible == 8.* + ansible9: ansible == 9.* commands = molecule test setenv = TOX_ENVNAME={envname}