diff --git a/.github/workflows/auto-merge-dependabot-updates.yml b/.github/workflows/auto-merge-dependabot-updates.yml new file mode 100644 index 0000000..7c8be89 --- /dev/null +++ b/.github/workflows/auto-merge-dependabot-updates.yml @@ -0,0 +1,18 @@ +--- +# +# Ansible managed +# + +name: Auto Merge Dependency Updates + +on: + - pull_request_target + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Auto Merge Dependabot Updates + uses: buluma/gh-action-auto-merge-dependabot-updates@1.0.5 + with: + allowed-actors: buluma, dependabot-preview[bot], dependabot[bot] diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index 7699945..b5cce5c 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: galaxy - uses: buluma/galaxy-action@1.1.0 + uses: buluma/galaxy-action@v1.0.3 with: galaxy_api_key: ${{ secrets.galaxy_api_key }} + git_branch: master diff --git a/.github/workflows/labelassign-action.yml b/.github/workflows/labelassign-action.yml new file mode 100644 index 0000000..223e265 --- /dev/null +++ b/.github/workflows/labelassign-action.yml @@ -0,0 +1,23 @@ +--- +# +# Ansible managed +# + +name: "Set Label and Assignee" + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + build: + runs-on: "ubuntu-20.04" + steps: + - name: "Label and Assign Issue/PR" + uses: "Naturalclar/issue-action@v2.0.2" + with: + title-or-body: "both" + parameters: '[ {"keywords": ["bug", "error"], "labels": ["BUG"], "assignees": ["buluma"]}, {"keywords": ["help", "guidance"], "labels": ["help-wanted"], "assignees": ["buluma"]}, {"keywords": ["feature", "request"], "labels": ["enhancement"], "assignees": ["buluma"]}]' + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index a59219b..ce56967 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -10,7 +10,7 @@ on: schedule: - cron: '15 8 * * *' workflow_dispatch: - push: {branches: ["master", "main", "testing"]} + push: {branches: ["master", "main"]} concurrency: group: ${{ github.ref }}-${{ github.workflow }} @@ -25,7 +25,7 @@ jobs: with: path: "${{ github.repository }}" - name: molecule - uses: buluma/molecule-action@v4.0.6 + uses: buluma/molecule-action@v4.0.7 with: command: lint test: @@ -45,10 +45,10 @@ jobs: - image: "fedora-systemd" tag: "34" - image: "fedora-systemd" - tag: "latest" + tag: "35" - image: "fedora-systemd" - tag: "rawhide" - - image: "opensuse" + tag: "latest" + - image: "docker-opensuse-systemd" tag: "latest" - image: "docker-ubuntu-systemd" tag: "latest" @@ -56,6 +56,8 @@ jobs: tag: "bionic" - image: "docker-ubuntu-systemd" tag: "focal" + - image: "docker-ubuntu-systemd" + tag: "jammy" steps: - name: checkout uses: actions/checkout@v3 @@ -66,7 +68,7 @@ jobs: - name: parse apparmor for mysql run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - name: molecule - uses: buluma/molecule-action@v4.0.6 + uses: buluma/molecule-action@v4.0.7 with: image: ${{ matrix.config.image }} tag: ${{ matrix.config.tag }} diff --git a/.github/workflows/release_drafter.yml b/.github/workflows/release_drafter.yml index 733f8d6..4bc6a9e 100644 --- a/.github/workflows/release_drafter.yml +++ b/.github/workflows/release_drafter.yml @@ -17,6 +17,10 @@ on: # Only following types are handled by the action, but one can default to all as well types: [opened, reopened, synchronize] +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: update_release_draft: runs-on: ubuntu-latest @@ -30,3 +34,36 @@ jobs: # disable-autolabeler: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + changelog_draft: + runs-on: ubuntu-latest + + steps: + - name: Checkout dj-wasabi-release repo + uses: actions/checkout@v3 + with: + repository: dj-wasabi/dj-wasabi-release + path: dj-wasabi-release + + - name: Checkout current repo + uses: actions/checkout@v3 + with: + path: master + + - 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 master + # Generate CHANGELOG.md file + ../dj-wasabi-release/release.sh -d + # Let commit the changes if there are any? (Well there should be!) + if [[ $(git status | grep -c 'CHANGELOG.md' || true) -gt 0 ]] + then echo "Committing file" + git config --global user.name 'Shadow Walker [GH bot]' + git config --global user.email 'github@buluma.me.ke' + git add CHANGELOG.md + git commit -m "Updated CHANGELOG.md on \"$(date "+%Y-%m-%d %H:%M:%S")\"" CHANGELOG.md + git push + fi + env: + CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index 007ba19..c6347d7 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -21,5 +21,5 @@ jobs: uses: "buluma/todo-to-issue-action@v1.0.1" id: "todo" with: - USER_PROJECTS: $buluma/Ansible/To do + USER_PROJECTS: buluma/Ansible/To do PROJECTS_SECRET: ${{ secrets.PROJECTS_SECRET }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ce2115..8a66686 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: "buluma/github-action-molecule:4.0.6" +image: "buluma/github-action-molecule:4.0.7" services: - docker:dind @@ -9,10 +9,10 @@ variables: PY_COLORS: 1 molecule: + stage: build + allow_failure: true script: - image=${image} tag=${tag} molecule test - rules: - - if: $CI_COMMIT_REF_NAME == "master" retry: 1 parallel: matrix: @@ -25,10 +25,10 @@ molecule: - image: "fedora-systemd" tag: "34" - image: "fedora-systemd" - tag: "latest" + tag: "35" - image: "fedora-systemd" - tag: "rawhide" - - image: "opensuse" + tag: "latest" + - image: "docker-opensuse-systemd" tag: "latest" - image: "docker-ubuntu-systemd" tag: "latest" @@ -36,8 +36,12 @@ molecule: tag: "bionic" - image: "docker-ubuntu-systemd" tag: "focal" + - image: "docker-ubuntu-systemd" + tag: "jammy" testing: + stage: test + needs: [] script: - image=${image} tag=${tag} molecule test rules: @@ -54,39 +58,10 @@ testing: - image: "fedora-systemd" tag: "34" - image: "fedora-systemd" - tag: "latest" + tag: "35" - image: "fedora-systemd" - tag: "rawhide" - - image: "opensuse" tag: "latest" - - image: "docker-ubuntu-systemd" - tag: "latest" - - image: "docker-ubuntu-systemd" - tag: "bionic" - - image: "docker-ubuntu-systemd" - tag: "focal" - -role_testing: - script: - - image=${image} tag=${tag} ansible-galaxy install buluma.haproxy - rules: - - if: $CI_COMMIT_REF_NAME == "testing" - retry: 1 - parallel: - matrix: - - image: "enterpriselinux" - tag: "latest" - - image: "debian-systemd" - tag: "latest" - - image: "debian-systemd" - tag: "bookworm" - - image: "fedora-systemd" - tag: "34" - - image: "fedora-systemd" - tag: "latest" - - image: "fedora-systemd" - tag: "rawhide" - - image: "opensuse" + - image: "docker-opensuse-systemd" tag: "latest" - image: "docker-ubuntu-systemd" tag: "latest" @@ -94,12 +69,18 @@ role_testing: tag: "bionic" - image: "docker-ubuntu-systemd" tag: "focal" + - image: "docker-ubuntu-systemd" + tag: "jammy" galaxy: + stage: deploy + needs: [] script: - ansible-galaxy role info buluma.haproxy -role_testing_live: +role_testing: + stage: test + needs: [] script: - image=${image} tag=${tag} ansible-galaxy install buluma.haproxy retry: 1 @@ -114,10 +95,10 @@ role_testing_live: - image: "fedora-systemd" tag: "34" - image: "fedora-systemd" - tag: "latest" + tag: "35" - image: "fedora-systemd" - tag: "rawhide" - - image: "opensuse" + tag: "latest" + - image: "docker-opensuse-systemd" tag: "latest" - image: "docker-ubuntu-systemd" tag: "latest" @@ -125,3 +106,23 @@ role_testing_live: tag: "bionic" - image: "docker-ubuntu-systemd" tag: "focal" + - image: "docker-ubuntu-systemd" + tag: "jammy" + +release_job: + stage: .post + needs: [molecule] + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: $CI_COMMIT_TAG + script: + - echo "Running the release job." + release: + tag_name: $CI_COMMIT_TAG + name: 'Release $CI_COMMIT_TAG' + description: 'Release created using the release-cli.' + artifacts: + name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME" + paths: + - / + expire_in: 1 day diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca0a7b8..17af3f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,7 +14,7 @@ repos: args: [-c=.yamllint] - repo: https://github.com/buluma/pre-commit - rev: v1.0.0 + rev: v1.0.2 hooks: - id: ansible_role_find_unused_variable - id: ansible_role_find_empty_files diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c828298 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,139 @@ +# Changelog + +## [Unreleased](https://github.com/buluma/ansible-role-haproxy/tree/HEAD) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.4.3...HEAD) + +**Merged pull requests:** + +- Bump buluma/gh-action-auto-merge-dependabot-updates from 1.0.4 to 1.0.5 [\#52](https://github.com/buluma/ansible-role-haproxy/pull/52) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v2.4.3](https://github.com/buluma/ansible-role-haproxy/tree/v2.4.3) (2022-04-24) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.4.2...v2.4.3) + +**Closed issues:** + +- Cannot detect the required Python library cryptography \(\>= 1.2.3\)"} [\#51](https://github.com/buluma/ansible-role-haproxy/issues/51) + +## [v2.4.2](https://github.com/buluma/ansible-role-haproxy/tree/v2.4.2) (2022-03-20) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.4.1...v2.4.2) + +## [v2.4.1](https://github.com/buluma/ansible-role-haproxy/tree/v2.4.1) (2022-03-10) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.4.0...v2.4.1) + +**Merged pull requests:** + +- Bump codacy/codacy-analysis-cli-action from 4.0.0 to 4.0.2 [\#49](https://github.com/buluma/ansible-role-haproxy/pull/49) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v2.4.0](https://github.com/buluma/ansible-role-haproxy/tree/v2.4.0) (2022-03-03) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.9...v2.4.0) + +**Merged pull requests:** + +- set concurrency [\#47](https://github.com/buluma/ansible-role-haproxy/pull/47) ([buluma](https://github.com/buluma)) + +## [v2.3.9](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.9) (2022-02-13) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.8...v2.3.9) + +**Merged pull requests:** + +- Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.0.0 [\#45](https://github.com/buluma/ansible-role-haproxy/pull/45) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v2.3.8](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.8) (2022-02-13) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.7...v2.3.8) + +**Fixed bugs:** + +- Build Failed [\#41](https://github.com/buluma/ansible-role-haproxy/issues/41) +- Build Failed [\#40](https://github.com/buluma/ansible-role-haproxy/issues/40) + +**Closed issues:** + +- Needs to be updated [\#42](https://github.com/buluma/ansible-role-haproxy/issues/42) + +**Merged pull requests:** + +- Testing [\#44](https://github.com/buluma/ansible-role-haproxy/pull/44) ([buluma](https://github.com/buluma)) +- Update .gitlab-ci.yml [\#43](https://github.com/buluma/ansible-role-haproxy/pull/43) ([buluma](https://github.com/buluma)) + +## [v2.3.7](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.7) (2022-02-01) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.6...v2.3.7) + +## [v2.3.6](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.6) (2022-02-01) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.4...v2.3.6) + +**Fixed bugs:** + +- Build Failed [\#39](https://github.com/buluma/ansible-role-haproxy/issues/39) +- Build Failed [\#38](https://github.com/buluma/ansible-role-haproxy/issues/38) +- Build Failed [\#37](https://github.com/buluma/ansible-role-haproxy/issues/37) +- Build Failed [\#36](https://github.com/buluma/ansible-role-haproxy/issues/36) +- Build Failed [\#35](https://github.com/buluma/ansible-role-haproxy/issues/35) +- Build Failed [\#34](https://github.com/buluma/ansible-role-haproxy/issues/34) +- Build Failed [\#33](https://github.com/buluma/ansible-role-haproxy/issues/33) +- Build Failed [\#32](https://github.com/buluma/ansible-role-haproxy/issues/32) +- Build Failed [\#31](https://github.com/buluma/ansible-role-haproxy/issues/31) +- Build Failed [\#30](https://github.com/buluma/ansible-role-haproxy/issues/30) +- Build Failed [\#29](https://github.com/buluma/ansible-role-haproxy/issues/29) +- Build Failed [\#28](https://github.com/buluma/ansible-role-haproxy/issues/28) +- Build Failed [\#27](https://github.com/buluma/ansible-role-haproxy/issues/27) +- Build Failed [\#26](https://github.com/buluma/ansible-role-haproxy/issues/26) +- Build Failed [\#25](https://github.com/buluma/ansible-role-haproxy/issues/25) +- Build Failed [\#24](https://github.com/buluma/ansible-role-haproxy/issues/24) +- Build Failed [\#23](https://github.com/buluma/ansible-role-haproxy/issues/23) +- Build Failed [\#22](https://github.com/buluma/ansible-role-haproxy/issues/22) +- Build Failed [\#21](https://github.com/buluma/ansible-role-haproxy/issues/21) +- Build Failed [\#20](https://github.com/buluma/ansible-role-haproxy/issues/20) + +## [v2.3.4](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.4) (2021-05-29) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v2.3.5...v2.3.4) + +## [v2.3.5](https://github.com/buluma/ansible-role-haproxy/tree/v2.3.5) (2021-05-29) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v1.2...v2.3.5) + +## [v1.2](https://github.com/buluma/ansible-role-haproxy/tree/v1.2) (2021-04-18) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v1.0...v1.2) + +## [v1.0](https://github.com/buluma/ansible-role-haproxy/tree/v1.0) (2021-04-18) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/v1.1...v1.0) + +**Merged pull requests:** + +- Add .circleci/config.yml [\#19](https://github.com/buluma/ansible-role-haproxy/pull/19) ([buluma](https://github.com/buluma)) + +## [v1.1](https://github.com/buluma/ansible-role-haproxy/tree/v1.1) (2021-03-28) + +[Full Changelog](https://github.com/buluma/ansible-role-haproxy/compare/89a7829d021e17c6e0bcd6f672d22d56880dacc8...v1.1) + +**Merged pull requests:** + +- update slack [\#18](https://github.com/buluma/ansible-role-haproxy/pull/18) ([buluma](https://github.com/buluma)) +- Update .codeclimate.yml [\#17](https://github.com/buluma/ansible-role-haproxy/pull/17) ([buluma](https://github.com/buluma)) +- Update Jenkinsfile [\#16](https://github.com/buluma/ansible-role-haproxy/pull/16) ([buluma](https://github.com/buluma)) +- Update Jenkinsfile [\#15](https://github.com/buluma/ansible-role-haproxy/pull/15) ([buluma](https://github.com/buluma)) +- Buluma jenkins [\#14](https://github.com/buluma/ansible-role-haproxy/pull/14) ([buluma](https://github.com/buluma)) +- add group: edge [\#13](https://github.com/buluma/ansible-role-haproxy/pull/13) ([buluma](https://github.com/buluma)) +- Create jenkinsfile [\#11](https://github.com/buluma/ansible-role-haproxy/pull/11) ([buluma](https://github.com/buluma)) +- Add a Codacy badge to README.md [\#10](https://github.com/buluma/ansible-role-haproxy/pull/10) ([codacy-badger](https://github.com/codacy-badger)) +- disable checkmode [\#9](https://github.com/buluma/ansible-role-haproxy/pull/9) ([buluma](https://github.com/buluma)) +- checkmodee [\#8](https://github.com/buluma/ansible-role-haproxy/pull/8) ([buluma](https://github.com/buluma)) +- print out test file [\#6](https://github.com/buluma/ansible-role-haproxy/pull/6) ([buluma](https://github.com/buluma)) +- force verbose of test file [\#3](https://github.com/buluma/ansible-role-haproxy/pull/3) ([buluma](https://github.com/buluma)) +- update distros and notifications [\#2](https://github.com/buluma/ansible-role-haproxy/pull/2) ([buluma](https://github.com/buluma)) +- First Commit [\#1](https://github.com/buluma/ansible-role-haproxy/pull/1) ([buluma](https://github.com/buluma)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/LICENSE b/LICENSE index b24ef60..69ff874 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache License - Version 2.0, 03 2022 + Version 2.0, 05 2022 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 2b0da33..0d46243 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -14,14 +14,23 @@ lint: | driver: name: docker platforms: - - name: "haproxy-${image:-fedora}-${tag:-latest}${TOX_ENVNAME}" - image: "${namespace:-buluma}/${image:-fedora}:${tag:-latest}" + - name: "haproxy-${image:-docker-centos7-ansible}-${tag:-latest}${TOX_ENVNAME}" + image: "${namespace:-buluma}/${image:-docker-centos7-ansible}:${tag:-latest}" command: /sbin/init volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: yes pre_build_image: yes + tty: true + environment: + container: docker provisioner: name: ansible + config_options: + defaults: + interpreter_python: auto_legacy_silent + callback_whitelist: profile_tasks + ssh_connection: + pipelining: true verifier: name: ansible diff --git a/requirements.txt b/requirements.txt index ba1d384..b0bf89c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ ansible>=2.10 # Some Jinja2 filters are used that are available in the newer releases. jinja2>=2.11.2 +jmespath diff --git a/tasks/main.yml b/tasks/main.yml index 921c76a..7674066 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -57,7 +57,7 @@ - ansible_selinux.status == "enabled" - name: flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers - name: start and enable haproxy ansible.builtin.service: