-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from tribe29/devel
Add agent role
- Loading branch information
Showing
22 changed files
with
453 additions
and
14 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 |
---|---|---|
|
@@ -18,6 +18,7 @@ on: | |
- 'changelogs/**' | ||
- '**.md' | ||
- '**.rst' | ||
- 'roles/**' | ||
|
||
env: | ||
NAMESPACE: tribe29 | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,11 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# | ||
# Prepare the environment. | ||
# | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -25,9 +30,31 @@ jobs: | |
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
# | ||
# First stage: Build and install collection to generate docs and changelogs. | ||
# | ||
|
||
- name: Copy Files and Directories to Source | ||
run: | | ||
mkdir -p build/src | ||
cp $files build/src | ||
cp -rf $directories build/src | ||
env: | ||
files: "CHANGELOG.rst LICENSE README.md ansible.cfg galaxy.yml" | ||
directories: "changelogs docs meta playbooks plugins roles" | ||
|
||
- name: Build Ansible Collection | ||
run: ansible-galaxy collection build build/src --force | ||
|
||
- name: Install Ansible Collection | ||
run: ansible-galaxy collection install ./tribe29-checkmk-${{ steps.current_version.outputs.version }}.tar.gz | ||
|
||
- name: Compile Collection Changelog | ||
run: antsibull-changelog release | ||
|
||
- name: Compile Collection Docs | ||
run: antsibull-docs collection --use-current --squash-hierarchy --fail-on-error --dest-dir ./docs/ tribe29.checkmk | ||
|
||
# https://github.com/marketplace/actions/create-pull-request | ||
- name: Create Pull Request for docs | ||
uses: peter-evans/create-pull-request@v3 | ||
|
@@ -36,24 +63,27 @@ jobs: | |
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
signoff: false | ||
branch: changelogs-update | ||
branch: changelogs-docs-update | ||
delete-branch: true | ||
title: '[Auto] Update changelogs' | ||
title: '[Auto] Update changelogs and docs' | ||
body: | | ||
Changelogs updated during *${{ steps.current_version.outputs.version }}* release. | ||
Changelogs and docs updated during *${{ steps.current_version.outputs.version }}* release. | ||
assignees: robin-tribe29 | ||
reviewers: robin-tribe29 | ||
draft: false | ||
|
||
# | ||
# Second stage: Build the final version of the collection and release it. | ||
# | ||
|
||
- name: Copy Files and Directories to Source | ||
run: | | ||
mkdir -p build/src | ||
cp $files build/src | ||
cp -rf $directories build/src | ||
env: | ||
files: "CHANGELOG.rst LICENSE README.md ansible.cfg galaxy.yml" | ||
# directories: "playbooks plugins roles vars" | ||
directories: "changelogs docs meta playbooks plugins" | ||
directories: "changelogs docs meta playbooks plugins roles" | ||
|
||
- name: Build Ansible Collection | ||
run: ansible-galaxy collection build build/src --force | ||
|
@@ -65,7 +95,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.current_version.outputs.version }} | ||
release_name: Release v${{ steps.current_version.outputs.version }} | ||
release_name: v${{ steps.current_version.outputs.version }} | ||
body: | | ||
# Ansible Collection: tribe29.checkmk | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
.*.swp | ||
.*.swo | ||
*~ | ||
.vagrant/ | ||
build/ | ||
tests/output | ||
playbooks/vars/config.yml | ||
playbooks/test.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
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,47 @@ | ||
# https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to | ||
minor_changes: | ||
- Add agent role. Currently supports the vanilla agent. | ||
|
||
# known_issues: | ||
# - This release is still in development and a heavy work in progress. | ||
# - Discovery module is not feature complete yet. | ||
# - Downtime module is not fully idempotent yet. This affects service downtimes and deletions. | ||
|
||
## Line Format | ||
# When writing a changelog entry, use the following format: | ||
|
||
# - scope - description starting with a lowercase letter and ending with a period at the very end. Multiple sentences are allowed (https://github.com/reference/to/an/issue or, if there is no issue, reference to a pull request itself). | ||
|
||
# The scope is usually a module or plugin name or group of modules or plugins, for example, lookup plugins. While module names can (and should) be mentioned directly (foo_module), plugin names should always be followed by the type (foo inventory plugin). | ||
|
||
# For changes that are not really scoped (for example, which affect a whole collection), use the following format: | ||
|
||
# - Description starting with an uppercase letter and ending with a dot at the very end. Multiple sentences are allowed (https://github.com/reference/to/an/issue or, if there is no issue, reference to a pull request itself). | ||
|
||
|
||
## Possible keys: | ||
|
||
# breaking_changes | ||
|
||
# Changes that break existing playbooks or roles. This includes any change to existing behavior that forces users to update tasks. Displayed in both the changelogs and the Porting Guides. | ||
# major_changes | ||
|
||
# Major changes to Ansible itself. Generally does not include module or plugin changes. Displayed in both the changelogs and the Porting Guides. | ||
# minor_changes | ||
|
||
# Minor changes to Ansible, modules, or plugins. This includes new features, new parameters added to modules, or behavior changes to existing parameters. | ||
# deprecated_features | ||
|
||
# Features that have been deprecated and are scheduled for removal in a future release. Displayed in both the changelogs and the Porting Guides. | ||
# removed_features | ||
|
||
# Features that were previously deprecated and are now removed. Displayed in both the changelogs and the Porting Guides. | ||
# security_fixes | ||
|
||
# Fixes that address CVEs or resolve security concerns. Include links to CVE information. | ||
# bugfixes | ||
|
||
# Fixes that resolve issues. | ||
# known_issues | ||
|
||
# Known issues that are currently not fixed or will not be fixed. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- name: "Test all modules." | ||
hosts: all | ||
hosts: test | ||
gather_facts: 'no' | ||
vars_files: | ||
- ./vars/config.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,42 @@ | ||
- name: "Run all roles." | ||
hosts: vagrant | ||
vars_files: | ||
- ./vars/config.yml | ||
|
||
roles: | ||
- agent | ||
|
||
# tasks: | ||
# - name: "Create host." | ||
# host: | ||
# server_url: "{{ server_url }}" | ||
# site: "{{ site }}" | ||
# automation_user: "{{ automation_user }}" | ||
# automation_secret: "{{ automation_secret }}" | ||
# host_name: "{{ inventory_hostname }}" | ||
# folder: "{{ checkmk_folder_path }}" | ||
# attributes: | ||
# site: "{{ site }}" | ||
# ipaddress: "{{ ansible_host }}" | ||
# state: "present" | ||
# delegate_to: localhost | ||
# - name: "Discover services on host." | ||
# discovery: | ||
# server_url: "{{ server_url }}" | ||
# site: "{{ site }}" | ||
# automation_user: "{{ automation_user }}" | ||
# automation_secret: "{{ automation_secret }}" | ||
# host_name: "{{ inventory_hostname }}" | ||
# state: "fix_all" | ||
# delegate_to: localhost | ||
# - name: "Activate changes." | ||
# activation: | ||
# server_url: "{{ server_url }}" | ||
# site: "{{ site }}" | ||
# automation_user: "{{ automation_user }}" | ||
# automation_secret: "{{ automation_secret }}" | ||
# force_foreign_changes: 'true' | ||
# sites: | ||
# - "{{ site }}" | ||
# delegate_to: localhost | ||
# run_once: '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ansible >= 4.10.0 | ||
antsibull-changelog >= 0.12.0 | ||
antsibull-changelog >= 0.12.0 | ||
antsibull-docs >= 1.1.0 |
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,4 @@ | ||
--- | ||
collections: | ||
- name: tribe29.checkmk | ||
version: 0.3.2 |
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 |
Oops, something went wrong.