-
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.
Fixed ansible-lint issues + workflows (#16)
# Pull Request Description - Fixed all ansible-lint issues - Added workflows (CI, Release Drafter, Publish to Galaxy) ## Change type - [x] Bug fix (non-breaking change which fixes a specific issue) - [ ] New feature (non-breaking change adding new functionality) - [ ] Breaking change (fix or feature that potentially causes existing functionality to fail) - [x] Change that does not affect Ansible Role code (Github Actions Workflow, Documentation, or similair)
- Loading branch information
1 parent
999a66b
commit 4fc8648
Showing
14 changed files
with
277 additions
and
113 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
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,41 @@ | ||
--- | ||
name-template: "$RESOLVED_VERSION" | ||
tag-template: "$RESOLVED_VERSION" | ||
categories: | ||
- title: "Breaking" | ||
lables: | ||
- "major" | ||
- "breaking" | ||
- title: "Features" | ||
labels: | ||
- "feature" | ||
- "enhancement" | ||
- title: "Bug Fixes" | ||
labels: | ||
- "bug" | ||
- "fix" | ||
- title: "Documentation" | ||
labels: | ||
- "documentation" | ||
- title: "Workflows" | ||
labels: | ||
- "workflow" | ||
version-resolver: | ||
major: | ||
labels: | ||
- "major" | ||
- "breaking" | ||
minor: | ||
labels: | ||
- "feature" | ||
- "enhancement" | ||
patch: | ||
labels: | ||
- "bug" | ||
- "fix" | ||
default: patch | ||
change-template: "- $TITLE, by @$AUTHOR (#$NUMBER)" | ||
template: | | ||
# Changes | ||
$CHANGES |
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,42 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [opened, reopened, synchronize] | ||
|
||
|
||
jobs: | ||
yamllint: | ||
name: YAML Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Python 3 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install deps | ||
run: pip3 install yamllint | ||
|
||
- name: Lint code | ||
run: yamllint . | ||
|
||
ansiblelint: | ||
name: Ansible Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main | ||
with: | ||
args: "--profile production" | ||
setup_python: "true" | ||
requirements_file: "./requirements.yml" |
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,22 @@ | ||
--- | ||
name: Release Drafter | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
draft_release: | ||
name: Draft Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v6 | ||
with: | ||
config-name: release_drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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,27 @@ | ||
--- | ||
name: Release to Ansible Galaxy | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
name: Ansible Galaxy Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Python 3 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install Ansible | ||
run: pip3 install ansible-core | ||
|
||
- name: Trigger a new import on Galaxy. | ||
run: >- | ||
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} | ||
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) |
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 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 150 | ||
level: warning | ||
comments: | ||
min-spaces-from-content: 1 | ||
comments-indentation: disable | ||
braces: | ||
max-spaces-inside: 1 | ||
octal-values: | ||
forbid-implicit-octal: true | ||
forbid-explicit-octal: true |
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
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,3 @@ | ||
--- | ||
collections: [] | ||
roles: [] |
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 |
---|---|---|
@@ -1,45 +1,46 @@ | ||
- block: | ||
- name: determine latest hubble cli version | ||
--- | ||
- name: Set Hubble version variable | ||
when: cilium_hubble_cli_version is not defined or cilium_hubble_cli_version == None | ||
block: | ||
- name: Determine latest Hubble CLI version | ||
ansible.builtin.uri: | ||
url: https://raw.githubusercontent.com/cilium/hubble/main/stable.txt | ||
return_content: true | ||
register: cilium_hubble_latest_version | ||
|
||
- name: set hubble desired version variable | ||
- name: Set Hubble desired version variable | ||
ansible.builtin.set_fact: | ||
cilium_hubble_cli_version: "{{ cilium_hubble_latest_version.content | trim }}" | ||
when: cilium_hubble_cli_version is not defined or cilium_hubble_cli_version == None | ||
|
||
- name: check if hubble cli binary exists | ||
- name: Check if Hubble CLI binary exists | ||
ansible.builtin.stat: | ||
path: "{{ cilium_hubble_cli_bin_path }}" | ||
register: cilium_hubble_cli_check | ||
|
||
- name: check hubble cli version | ||
ansible.builtin.shell: | ||
cmd: "{{ cilium_hubble_cli_bin_path }} version" | ||
- name: Check Hubble CLI version | ||
ansible.builtin.command: "{{ cilium_hubble_cli_bin_path }} version" | ||
failed_when: false | ||
changed_when: false | ||
register: cilium_hubble_cli_existing_version | ||
|
||
- block: | ||
- name: set hubble cli architecture var | ||
- name: Install Hubble CLI | ||
when: not cilium_hubble_cli_check.stat.exists or cilium_hubble_cli_version[1:] not in cilium_hubble_cli_existing_version.stdout | ||
block: | ||
- name: Set Hubble CLI architecture var | ||
ansible.builtin.set_fact: | ||
cilium_hubble_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" | ||
|
||
- name: download hubble cli | ||
- name: Download Hubble CLI | ||
ansible.builtin.unarchive: | ||
src: "https://github.com/cilium/hubble/releases/download/{{ cilium_hubble_cli_version }}/hubble-linux-{{ cilium_hubble_arch }}.tar.gz" | ||
dest: /tmp | ||
remote_src: true | ||
mode: 0755 | ||
mode: "0755" | ||
|
||
- name: copy hubble cli binary into place. | ||
- name: Copy Hubble CLI binary into place. | ||
ansible.builtin.copy: | ||
src: "/tmp/hubble" | ||
dest: "{{ cilium_hubble_cli_bin_path }}" | ||
mode: 0755 | ||
mode: "0755" | ||
remote_src: true | ||
become: true | ||
when: cilium_hubble_cli_check.stat.exists == false or cilium_hubble_cli_version[1:] not in cilium_hubble_cli_existing_version.stdout | ||
|
Oops, something went wrong.