-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4ffeb9e
Showing
29 changed files
with
453 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
skip_list: | ||
- 'role-name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: 'Molecule' | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: 'Test' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- distro: 'debian-12' | ||
- distro: 'rockylinux-9' | ||
- distro: 'ubuntu-22.04' | ||
|
||
steps: | ||
- name: 'Checkout the codebase' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Test role' | ||
uses: gofrolist/molecule-action@v2 | ||
with: | ||
molecule_command: test | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
TAG: ${{ matrix.distro }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: 'Publish' | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout the codebase' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Publish to Ansible Galaxy' | ||
uses: robertdebock/[email protected] | ||
with: | ||
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }} | ||
git_branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: 'Release' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: 'Release' | ||
runs-on: ubuntu-latest | ||
# Skip running release workflow on forks | ||
if: github.repository_owner == 'antmelekhin' | ||
steps: | ||
- name: 'Checkout the codebase' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: 'Semantic Release' | ||
uses: cycjimmy/semantic-release-action@v3 | ||
with: | ||
semantic_version: 19.0.5 | ||
extra_plugins: | | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
branches: ['main'] | ||
preset: 'conventionalcommits' | ||
ci: false | ||
|
||
verifyConditions: | ||
- '@semantic-release/changelog' | ||
- '@semantic-release/git' | ||
- '@semantic-release/github' | ||
|
||
analyzeCommits: | ||
- path: '@semantic-release/commit-analyzer' | ||
releaseRules: | ||
- type: 'breaking' | ||
release: 'major' | ||
- type: 'chore' | ||
release: false | ||
- type: 'ci' | ||
release: false | ||
- type: 'docs' | ||
release: false | ||
- type: 'feat' | ||
release: 'minor' | ||
- type: 'fix' | ||
release: 'patch' | ||
- type: 'improv' | ||
release: 'minor' | ||
- type: 'refactor' | ||
release: 'patch' | ||
- type: 'revert' | ||
release: 'patch' | ||
- type: 'style' | ||
release: false | ||
- type: 'test' | ||
release: false | ||
|
||
generateNotes: | ||
- path: '@semantic-release/release-notes-generator' | ||
writerOpts: | ||
groupBy: 'type' | ||
commitGroupsSort: 'title' | ||
commitsSort: 'header' | ||
linkCompare: true | ||
linkReferences: true | ||
presetConfig: | ||
types: | ||
- type: 'breaking' | ||
section: 'Breaking changes!' | ||
hidden: false | ||
- type: 'chore' | ||
section: 'Miscellaneous Chores' | ||
hidden: true | ||
- type: 'ci' | ||
section: 'Continuous Integration' | ||
hidden: false | ||
- type: 'docs' | ||
section: 'Documentation' | ||
hidden: false | ||
- type: 'feat' | ||
section: 'Features' | ||
hidden: false | ||
- type: 'fix' | ||
section: 'Fixes' | ||
hidden: false | ||
- type: 'improv' | ||
section: 'Improvements' | ||
hidden: false | ||
- type: 'refactor' | ||
section: 'Code Refactoring' | ||
hidden: false | ||
- type: 'revert' | ||
section: 'Reverts' | ||
hidden: false | ||
- type: 'style' | ||
section: 'Styles' | ||
hidden: false | ||
- type: 'test' | ||
section: 'Tests' | ||
hidden: false | ||
|
||
prepare: | ||
- path: '@semantic-release/changelog' | ||
changelogFile: 'CHANGELOG.md' | ||
changelogTitle: '# Changelog' | ||
- path: '@semantic-release/git' | ||
assets: ['CHANGELOG.md'] | ||
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
|
||
publish: | ||
- path: '@semantic-release/github' | ||
|
||
success: false | ||
|
||
fail: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
max-spaces-after: -1 | ||
level: error | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: disable | ||
truthy: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Anton Melekhin | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Java | ||
==== | ||
|
||
An Ansible role for install Java. | ||
|
||
Requirements | ||
------------ | ||
|
||
- Supported version of Ansible: 2.12 and highter. | ||
- Supported platforms: | ||
- Debian | ||
- 10 | ||
- 11 | ||
- 12 | ||
- RHEL | ||
- 7 | ||
- 8 | ||
- 9 | ||
- Ubuntu | ||
- 18.04 | ||
- 20.04 | ||
- 22.04 | ||
|
||
Role Variables | ||
-------------- | ||
|
||
- `java_packages` List of `Java` packages (see default values in `vars/*.yml`). | ||
|
||
Dependencies | ||
------------ | ||
|
||
None. | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- Install `Java` package: | ||
|
||
```yaml | ||
--- | ||
|
||
- name: 'Install Java package' | ||
hosts: all | ||
|
||
roles: | ||
- role: antmelekhin.java | ||
``` | ||
License | ||
------- | ||
MIT | ||
Author Information | ||
------------------ | ||
Melekhin Anton. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
java_packages: '{{ _java_packages }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
galaxy_info: | ||
author: antmelekhin | ||
role_name: java | ||
description: An Ansible role for install Java. | ||
|
||
license: MIT | ||
|
||
min_ansible_version: '2.12' | ||
|
||
platforms: | ||
- name: Debian | ||
versions: | ||
- 'buster' | ||
- 'bullseye' | ||
- 'bookworm' | ||
- name: EL | ||
versions: | ||
- '7' | ||
- '8' | ||
- '9' | ||
- name: Ubuntu | ||
versions: | ||
- 'bionic' | ||
- 'focal' | ||
- 'jammy' | ||
|
||
galaxy_tags: | ||
- 'openjdk' | ||
- 'java' | ||
- 'jdk' | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
roles: | ||
- role: antmelekhin.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
enabled: true | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
platforms: | ||
- name: '${IMAGE:-docker-systemd}-${TAG:-ubuntu-22.04}${TOX_ENVNAME}' | ||
image: '${NAMESPACE:-antmelekhin}/${IMAGE:-docker-systemd}:${TAG:-ubuntu-22.04}' | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
- /var/lib/containerd | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: 'Verify' | ||
hosts: all | ||
gather_facts: false | ||
|
||
tasks: | ||
- name: 'Check current Java version' | ||
ansible.builtin.command: | ||
cmd: java --version | ||
changed_when: false | ||
register: _java_version_check | ||
|
||
- name: 'Java version output' | ||
ansible.builtin.debug: | ||
msg: '{{ _java_version_check.stdout }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: 'Set JAVA_HOME if configured' | ||
ansible.builtin.template: | ||
src: 'java_home.sh.j2' | ||
dest: '/etc/profile.d/java_home.sh' | ||
mode: 0755 | ||
when: java_home is defined and java_home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: 'Install Java packages' | ||
ansible.builtin.apt: | ||
name: '{{ java_packages }}' | ||
update_cache: true | ||
state: present | ||
become: true |
Oops, something went wrong.