Skip to content

Commit 43e4115

Browse files
authored
Merge pull request #12 from markosamuli/feature/v2
Support for RedHat-based systems and latest Ansible versions
2 parents 1a38b3e + 7aaa59f commit 43e4115

40 files changed

+1026
-474
lines changed

.ansible-lint

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
---
12
exclude_paths:
2-
- .travis.yml
3+
- .travis.yml
4+
- .ansible-lint
5+
- .github/

.github/workflows/pipeline.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
name: Test and release
3+
4+
# This workflow is triggered on pushes to the repository.
5+
on:
6+
pull_request:
7+
branches:
8+
- "**"
9+
push:
10+
branches:
11+
- master
12+
tags:
13+
- v.*
14+
15+
jobs:
16+
lint:
17+
name: Lint with pre-commit
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version: "18"
25+
26+
- uses: actions/setup-python@v3
27+
with:
28+
python-version: "3.11"
29+
30+
- uses: actions/setup-go@v3
31+
with:
32+
go-version: "1.19"
33+
34+
- name: Install dependencies
35+
run: |
36+
pip3 install pre-commit
37+
go install mvdan.cc/sh/v3/cmd/shfmt@latest
38+
sudo apt-get install -y shellcheck
39+
python --version
40+
shfmt -version
41+
shellcheck --version
42+
pre-commit --version
43+
44+
- name: Cache pre-commit dependencies
45+
uses: actions/cache@v3
46+
with:
47+
path: ~/.cache/pre-commit/
48+
# yamllint disable-line rule:line-length
49+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
50+
restore-keys: |
51+
${{ runner.os }}-pre-commit-
52+
53+
- name: Run pre-commit
54+
run: pre-commit run -a
55+
56+
ubuntu:
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
distrib: [ubuntu]
61+
release: [focal, jammy, bionic]
62+
63+
name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
64+
env:
65+
DISTRIB: ${{ matrix.distrib }}
66+
RELEASE: ${{ matrix.release }}
67+
steps:
68+
- uses: actions/checkout@v3
69+
70+
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
71+
run: ./tests/run-tests ${DISTRIB}-${RELEASE}
72+
73+
debian:
74+
runs-on: ubuntu-latest
75+
strategy:
76+
matrix:
77+
distrib: [debian]
78+
release: [bullseye, buster]
79+
80+
name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
81+
env:
82+
DISTRIB: ${{ matrix.distrib }}
83+
RELEASE: ${{ matrix.release }}
84+
steps:
85+
- uses: actions/checkout@v3
86+
87+
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
88+
run: ./tests/run-tests ${DISTRIB}-${RELEASE}
89+
90+
fedora:
91+
runs-on: ubuntu-latest
92+
strategy:
93+
matrix:
94+
distrib: [fedora]
95+
release: [37]
96+
97+
name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
98+
env:
99+
DISTRIB: ${{ matrix.distrib }}
100+
RELEASE: ${{ matrix.release }}
101+
steps:
102+
- uses: actions/checkout@v3
103+
104+
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
105+
run: ./tests/run-tests ${DISTRIB}-${RELEASE}
106+
107+
release:
108+
name: Publish tagged releases to Ansible Galaxy
109+
needs:
110+
- lint
111+
- ubuntu
112+
- debian
113+
- fedora
114+
runs-on: ubuntu-latest
115+
if: startsWith(github.ref, 'refs/tags/v')
116+
steps:
117+
- name: galaxy
118+
uses: robertdebock/galaxy-action@1.2.0
119+
with:
120+
galaxy_api_key: ${{ secrets.galaxy_api_key }}

.pre-commit-config.yaml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,46 @@
1-
# -*- mode: yaml -*-
2-
# vim:ts=2:sw=2:ai:si:syntax=yaml
3-
################################
4-
# pre-commit hooks configuration
5-
################################
61
---
7-
82
repos:
93
- repo: https://github.com/pre-commit/pre-commit-hooks.git
10-
rev: v2.2.3
4+
rev: v4.4.0
115
hooks:
126
- id: check-executables-have-shebangs
137
- id: check-byte-order-marker
148
- id: check-case-conflict
159
- id: check-merge-conflict
1610
- id: trailing-whitespace
17-
args: ['--markdown-linebreak-ext=md']
11+
args: ["--markdown-linebreak-ext=md"]
1812
- id: end-of-file-fixer
1913
- id: mixed-line-ending
20-
args: ['--fix=lf']
14+
args: ["--fix=lf"]
2115
- id: check-yaml
2216
- id: pretty-format-json
23-
args: ['--autofix', '--indent=2', '--no-sort-keys']
17+
args: ["--autofix", "--indent=2", "--no-sort-keys"]
2418

2519
- repo: https://github.com/adrienverge/yamllint.git
26-
rev: v1.16.0
20+
rev: v1.29.0
2721
hooks:
2822
- id: yamllint
2923

3024
- repo: https://github.com/ansible/ansible-lint.git
31-
rev: v4.1.0
25+
rev: v6.13.1
3226
hooks:
3327
- id: ansible-lint
3428
files: \.(yaml|yml)$
29+
exclude: .github/workflows/pipeline.yml
3530

36-
- repo: https://github.com/bemeurer/beautysh.git
37-
rev: '4.1'
31+
- repo: https://github.com/syntaqx/git-hooks
32+
rev: v0.0.17
3833
hooks:
39-
- id: beautysh
34+
- id: shellcheck
4035
files: (tests/run-.*|tests/update)$
4136

42-
- repo: https://github.com/openstack-dev/bashate.git
43-
rev: '0.6.0'
37+
- repo: https://github.com/scop/pre-commit-shfmt
38+
rev: v3.6.0-1
4439
hooks:
45-
- id: bashate
40+
- id: shfmt
4641
files: (tests/run-.*|tests/update)$
4742

4843
- repo: https://github.com/igorshubovych/markdownlint-cli.git
49-
rev: v0.17.0
44+
rev: v0.33.0
5045
hooks:
5146
- id: markdownlint

CHANGELOG.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,81 @@
11
# Changelog
22

3+
## [2.0.0] - 2023-02-17
4+
5+
### Ansible compatibility
6+
7+
- Require Ansible 2.9.22
8+
- Support Ansible 7.2.0
9+
- Use fully qualified collection names (FQCN) with builtin modules
10+
11+
### Fixes
12+
13+
- Use `become_user` instead of `become` when installing with Git by [@Hunsu] in [#6]
14+
- Remove installer script checksum that causes issues [#10]
15+
16+
[@hunsu]: https://github.com/Hunsu
17+
[#6]: https://github.com/markosamuli/ansible-linuxbrew/pull/6
18+
[#10]: https://github.com/markosamuli/ansible-linuxbrew/issues/10
19+
20+
### Python compatibility
21+
22+
- Use Python 3 on all test Docker images
23+
- Drop support for EOL Python 2.7
24+
25+
### OS compatibility
26+
27+
- Add support for Ubuntu 20.04 LTS and 22.04 LTS
28+
- Add support for Debian 11
29+
- Add support for Fedora 37 and RedHat based-systems by [@aarey] in [#9]
30+
- Drop support for Debian 11
31+
- Drop support for Ubuntu 16.04 LTS
32+
33+
[@aarey]: https://github.com/aairey
34+
[#9]: https://github.com/markosamuli/ansible-linuxbrew/pull/9
35+
36+
### Testing
37+
38+
- Run tests with supported Docker images on GitHub Actions
39+
340
## [1.2.2] - 2020-09-06
441

542
### Fixed
643

7-
* Update `install.sh` checksum
8-
* Create missing `var/homebrew/linked` directory
9-
* Update `linuxbrew-core` repository URL
44+
- Update `install.sh` checksum
45+
- Create missing `var/homebrew/linked` directory
46+
- Update `linuxbrew-core` repository URL
1047

1148
## [1.2.1] - 2020-09-05
1249

1350
### Fixed
1451

15-
* Migrate to the new `install.sh` script
52+
- Migrate to the new `install.sh` script
1653

1754
## [1.2.0] - 2019-10-25
1855

1956
### Changes
2057

21-
* Add `linuxbrew_init_shell` variable to allow shell file modification to be
58+
- Add `linuxbrew_init_shell` variable to allow shell file modification to be
2259
disabled. Fixes [#1]
2360

2461
## [1.1.1] - 2019-07-20
2562

2663
### Fixes
2764

28-
* Updated `install.sh` checksum for the 2019-07-18 updated version.
65+
- Updated `install.sh` checksum for the 2019-07-18 updated version.
2966

3067
## [1.1.0] - 2019-07-14
3168

3269
### Changes
3370

34-
* Use Ansible tasks to clone the Homebrew Git repositories, create directories
71+
- Use Ansible tasks to clone the Homebrew Git repositories, create directories
3572
and set permissions where possible instead of using the official installer
3673
bash script.
3774

3875
### Fixes
3976

40-
* Install installation dependencies.
41-
* Update both `.bashrc` and `.zshrc` shell scripts.
77+
- Install installation dependencies.
78+
- Update both `.bashrc` and `.zshrc` shell scripts.
4279

4380
## [1.0.0] - 2019-01-13
4481

Makefile

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1-
PRE_COMMIT_HOOKS=.git/hooks/pre-commit
1+
2+
.DEFAULT_GOAL := help
3+
4+
# Use VERBOSE=1 make <command> to get verbose output
5+
ifndef VERBOSE
6+
.SILENT:
7+
endif
8+
9+
.PHONY: help
10+
help: ## print this help
11+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -d | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
12+
@echo ""
13+
$(MAKE) list-images
14+
15+
PRE_COMMIT_HOOKS = .git/hooks/pre-commit
16+
17+
TEST_IMAGES = $(shell ls tests/*/Dockerfile | xargs dirname | xargs basename)
18+
19+
.PHONY: setup
20+
setup: $(PRE_COMMIT_HOOKS)
221

322
.PHONY: test
4-
test:
5-
@./tests/run-tests
23+
test: ## run tests with all available Docker images
24+
./tests/run-tests
25+
26+
.PHONY: list-images
27+
list-images: ## list available test images
28+
@echo "Available test images:"
29+
@for i in $(TEST_IMAGES); do echo "$$i" | awk '{printf "\033[36m%-30s\033[0m run tests with %s\n", $$1, $$1}'; done
30+
31+
.PHONY: $(TEST_IMAGES)
32+
$(TEST_IMAGES):
33+
./tests/run-tests $@
634

735
.PHONY: lint
836
lint: $(PRE_COMMIT_HOOKS)
9-
@pre-commit run -a
37+
pre-commit run -a
1038

1139
$(PRE_COMMIT_HOOKS):
12-
@pre-commit install
40+
pre-commit install

0 commit comments

Comments
 (0)