This commit is contained in:
decentral1se 2022-05-31 07:17:48 +02:00
parent bf5b28933c
commit 6a092d33d7
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
7 changed files with 68 additions and 4 deletions

4
.ansible-lint.yml Normal file
View File

@ -0,0 +1,4 @@
---
skip_list:
- fqcn-builtins
- experimental

16
.drone.yml Normal file
View File

@ -0,0 +1,16 @@
----
kind: pipeline
name: default
steps:
- name: integration test
image: python:3.9-buster
environment:
REMOTE_USER: molecule
HCLOUD_TOKEN:
from_secret: HCLOUD_TOKEN
commands:
- apt update && apt install -y pwgen
- mkdir -p /root/.ansible/roles && ln -sr . /root/.ansible/roles/autonomic.netdata
- export INSTANCE_UUID=$(pwgen 8 1)
- pip install -r requirements.txt
- molecule test

18
.envrc.sample Normal file
View File

@ -0,0 +1,18 @@
# Your username that you use for accounts on our machines.
export REMOTE_USER=
export ANSIBLE_USER=$REMOTE_USER
# The path to our pass credentials store
export PASSWORD_STORE_DIR=
# The Hetzner Cloud API token for managing our instances
# Uncomment the prod/test line below depending on what you're doing
# export HCLOUD_TOKEN=$(pass show logins/hetzner/prod/api_key)
# export HCLOUD_TOKEN=$(pass show logins/hetzner/test/api_key)
export HCLOUD_TOKEN=$(pass show logins/hetzner/cicd/api_key)
# For molecule role testing
export INSTANCE_UUID=$RANDOM
# So molecule will show credentials in the logs
export MOLECULE_NO_LOG=False

16
.yamllint.yml Executable file
View File

@ -0,0 +1,16 @@
---
extends: default
yaml-files:
- "*.yaml"
- "*.yml"
ignore: |
.venv
.drone.yml
rules:
line-length: disable
braces:
max-spaces-inside: 1
level: error

View File

@ -2,9 +2,10 @@
dependencies: [] dependencies: []
galaxy_info: galaxy_info:
role_name: netdata
namespace: autonomic
author: autonomic author: autonomic
description: | description: Install and configure Netdata how we need it.
Install and configure Netdata how we need it.
company: Autonomic company: Autonomic
license: GPLv3 license: GPLv3
min_ansible_version: 2.9 min_ansible_version: 2.9

View File

@ -1,18 +1,23 @@
--- ---
dependency: dependency:
name: galaxy name: galaxy
driver: driver:
name: hetznercloud name: hetznercloud
platforms: platforms:
- name: "autonomic.netdata-${INSTANCE_UUID}" - name: "autonomic.netdata-${INSTANCE_UUID}"
server_type: "cx11" server_type: "cx11"
image: "debian-10" image: "debian-10"
provisioner: provisioner:
name: ansible name: ansible
lint: | lint: |
set -e set -e
yamllint -c ../../.yamllint.yml . yamllint -c .yamllint.yml .
ansible-lint -c ../../.ansible-lint.yml . ansible-lint --exclude .drone.yml -c .ansible-lint.yml .
scenario: scenario:
test_sequence: test_sequence:
- lint - lint

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
ansible-lint==6.0.0
ansible==5.4.0
molecule-hetznercloud==1.3.0
molecule==3.6.1