🎉 Init

This commit is contained in:
SebClem 2022-02-04 16:11:54 +01:00
commit 7a9442d88f
No known key found for this signature in database
GPG Key ID: 3D8E353F900B1305
11 changed files with 122 additions and 0 deletions

49
.drone.yml Normal file
View File

@ -0,0 +1,49 @@
kind: pipeline
name: default
steps:
- name: Check ansible syntax
image: harbor.sebclem.fr/sebclem/drone-ansible-runner
settings:
playbook: sites.yml
galaxy_file: roles/requirements.yml
check_syntax: true
vault_token:
from_secret: ansible_vault_token
private_key:
from_secret: ansible_private_key
when:
event:
- promote
- rollback
- push
- custom
- name: Run ansible playbook
image: harbor.sebclem.fr/sebclem/drone-ansible-runner
settings:
verbosity: 1
playbook: sites.yml
galaxy_file: roles/requirements.yml
vault_token:
from_secret: ansible_vault_token
private_key:
from_secret: ansible_private_key
when:
event:
- promote
- rollback
- name: Notify
image: drillster/drone-email
settings:
host:
from_secret: mail_host
username:
from_secret: mail_username
password:
from_secret: mail_password
from:
from_secret: mail_from
when:
status: [ changed, failure ]

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# ---> Ansible
*.retry
*vault_token
roles/
!roles/requirements.yml

1
README.md Normal file
View File

@ -0,0 +1 @@
${REPO_NAME_TITLE}

8
ansible.cfg Normal file
View File

@ -0,0 +1,8 @@
[defaults]
inventory = hosts
remote_user = root
host_key_checking = True
vault_password_file = credentials/vault_token
roles_path = ./roles
force_color = true
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}

1
group_vars/nodes.yml Normal file
View File

@ -0,0 +1 @@
ansible_python_interpreter: /usr/bin/python3

0
host_vars/hostname.yml Normal file
View File

7
hosts Normal file
View File

@ -0,0 +1,7 @@
---
all:
children:
nodes:
hosts:
victoria.home:

15
renovate.json Normal file
View File

@ -0,0 +1,15 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"commitMessagePrefix": ":arrow_up:",
"regexManagers": [
{
"fileMatch": ["host_vars\\/.*\\.yml"],
"matchStrings": ["victoriametrics_version:\\s?\"?(?<currentValue>.*?)\"?\\n"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "VictoriaMetrics/VictoriaMetrics"
}
]
}

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
ansible
hvac

19
secrets/hostname.yml Normal file
View File

@ -0,0 +1,19 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"ignorePresets": [":prHourlyLimit2"],
"commitMessagePrefix": ":arrow_up:",
"regexManagers": [
{
"fileMatch": [
"group_vars\\/.*\\.yml",
"host_vars\\/.*\\.yml"],
"matchStrings": [
"datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*?_version: \"(?<currentValue>.*)\"\\s"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
]
}

15
sites.yml Normal file
View File

@ -0,0 +1,15 @@
---
- name: ${REPO_NAME_TITLE}
hosts: nodes
pre_tasks:
- name: Load secrets
include_vars:
file: "secrets/{{ inventory_hostname }}.yml"
tags:
- always
roles: []