Skip to content

Commit

Permalink
Merge pull request #6 from arillso/feature/ansible-lint-update
Browse files Browse the repository at this point in the history
feat(lint): Update ansible-lint rules to latest standards
  • Loading branch information
sbaerlocher authored Nov 19, 2023
2 parents 4dea788 + c3404fd commit e80b1e4
Show file tree
Hide file tree
Showing 24 changed files with 442 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
skip_list:
- galaxy[version-incorrect]
39 changes: 30 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
---
version: 2
# Specifies the configuration version for Dependabot. Version 2 is the latest version.

updates:
- package-ecosystem: github-actions
# Configuration for updating GitHub Actions
- package-ecosystem: "github-actions"
# Specifies that GitHub Actions is the package ecosystem to be updated.
directory: "/"
# Sets the directory within the repository where Dependabot looks for GitHub Actions definitions.
# "/" indicates the root directory of the repository.

schedule:
interval: monthly
reviewers:
- sbaerlocher
interval: "weekly"
# Defines the update frequency. "weekly" means Dependabot checks for updates once a week.
day: "friday"
# Specifies the day of the week when Dependabot should run, set here to Friday.
time: "13:00"
# Sets the time for the Dependabot run. "13:00" is 1:00 PM UTC, corresponding to 2:00 PM in Zurich during winter.

commit-message:
prefix: "chore"
prefix-development: "chore"
include: "scope"
# Configures the commit message settings for Dependabot.
# 'prefix' and 'prefix-development' set a prefix for commit messages.
# 'include: "scope"' includes the scope of the dependencies in the commit message.

assignees:
- "sbaerlocher"
# Specifies GitHub users to be automatically assigned to Dependabot pull requests.
# Here, 'sbaerlocher' is the user who will be assigned to the pull requests.

reviewers:
- sbaerlocher
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Specifies GitHub users to be set as reviewers for Dependabot pull requests.
# In this configuration, 'sbaerlocher' is designated as the reviewer.
5 changes: 2 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4
uses: super-linter/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
231 changes: 231 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,jetbrains+all,jetbrains,ansible,basic,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,jetbrains+all,jetbrains,ansible,basic,linux

### Ansible ###
*.retry

### Basic ###
# Apples Build
*.build
*.apples

# Initialized files
*.exe
*.ini
*.basic

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml

### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff

# AWS User-specific

# Generated files

# Sensitive or high-churn files

# Gradle

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake

# Mongo Explorer plugin

# File-based project format

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# SonarLint plugin

# Crashlytics plugin (for Android Studio and IntelliJ)

# Editor-based Rest Client

# Android studio 3.1+ serialized cache file

### JetBrains+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### dotenv ###
.env.local

### mutagen ###
*.lock

### dde ###
.dde/*

# End of https://www.toptal.com/developers/gitignore/api/dotenv,visualstudiocode,jetbrains+all,jetbrains,ansible,basic,linux
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/ansible/ansible-lint
rev: v6.22.0
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
5 changes: 3 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ license:
tags:
- agents
- grafana
- linux

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies:
chocolatey.chocolatey: '>=1.3.0'
ansible.windows: '>=1.10.0'
chocolatey.chocolatey: ">=1.3.0"
ansible.windows: ">=1.10.0"

# The URL of the originating SCM repository
repository: https://github.com/arillso/ansible.agents
Expand Down
3 changes: 2 additions & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requires_ansible: ">=2.10"
---
requires_ansible: ">=2.15.5"
1 change: 0 additions & 1 deletion roles/do/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

do_packages:
- name: do-agent

Expand Down
20 changes: 20 additions & 0 deletions roles/do/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
argument_specs:
main:
short_description: Install DigitalOcean Agent
description:
- Installs the DigitalOcean Agent on the target system.
options:
do_packages:
type: list
elements: dict
description:
- A list of package names and versions to install for the DigitalOcean Agent.
- Default is to use the distribution's package manager to install the latest version of the agent.
default: [{ "name": "do-agent" }]
required: false
do_service_name:
type: str
description: The name of the service that runs the DigitalOcean Agent. Default is 'do-agent'.
default: do-agent
required: false
2 changes: 1 addition & 1 deletion roles/do/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ galaxy_info:
description: Cross-distro installation of the DigitalOcean monitoring agent.
author: "arillso (@arillso)"
license: MIT
min_ansible_version: 2.11
min_ansible_version: "2.15"
platforms:
- name: Ubuntu
versions:
Expand Down
9 changes: 7 additions & 2 deletions roles/do/tasks/install_do_debian.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---

- name: Run arillso apt Repositories
ansible.builtin.include_role:
name: arillso.system.apt_repositories
vars:
apt_repositories:
apt_repositories_list:
- repo: "deb https://repos.insights.digitalocean.com/apt/do-agent main main"
filename: "digitalocean-agent"

- name: Run arillso Package
ansible.builtin.include_role:
name: arillso.system.packages
vars:
packages_list: "{{ do_packages }}"
Loading

0 comments on commit e80b1e4

Please sign in to comment.