From 01a1fe343393a6f9ce1f9f8be37fdd386cdb5dc1 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 31 May 2022 09:42:00 +0200 Subject: [PATCH] more config --- .ansible-lint.yml | 4 ++++ .drone.yml | 16 ++++++++++++++++ .envrc.sample | 18 ++++++++++++++++++ .yamllint.yml | 16 ++++++++++++++++ molecule/default/molecule.yml | 2 +- 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .ansible-lint.yml create mode 100644 .drone.yml create mode 100644 .envrc.sample create mode 100755 .yamllint.yml diff --git a/.ansible-lint.yml b/.ansible-lint.yml new file mode 100644 index 0000000..25636f8 --- /dev/null +++ b/.ansible-lint.yml @@ -0,0 +1,4 @@ +--- +skip_list: + - fqcn-builtins + - experimental diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9cefdfe --- /dev/null +++ b/.drone.yml @@ -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/${ROLE_NAME} + - export INSTANCE_UUID=$(pwgen 8 1) + - pip install -r requirements.txt + - molecule test diff --git a/.envrc.sample b/.envrc.sample new file mode 100644 index 0000000..8a266bf --- /dev/null +++ b/.envrc.sample @@ -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 diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100755 index 0000000..456c99c --- /dev/null +++ b/.yamllint.yml @@ -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 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 19ee81a..5538d59 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -6,7 +6,7 @@ driver: name: hetznercloud platforms: - - name: "autonomic.add-users-${INSTANCE_UUID}" + - name: "${ROLE_NAME}-$${INSTANCE_UUID}" server_type: cx11 image: debian-10