From 227fb86b04526fec5be6f730687d4d4a4a0b5a0a Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Fri, 17 Apr 2026 16:57:22 +0300 Subject: [PATCH] test --- .woodpecker.yml | 18 ++++++++++++++++++ ansible/group_vars/all.yml | 5 ++--- ansible/inventory/hosts.yml | 13 ++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index d34544c..d148a6a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,19 +6,37 @@ steps: validate: image: ansible/ansible:latest + environment: + SSH_PRIVATE_KEY: + from_secret: SSH_PRIVATE_KEY commands: + - mkdir -p ~/.ssh + - echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa - ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/validate.yml drift-check: image: ansible/ansible:latest + environment: + SSH_PRIVATE_KEY: + from_secret: SSH_PRIVATE_KEY commands: + - mkdir -p ~/.ssh + - echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa - ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/drift-check.yml when: event: pull_request deploy: image: ansible/ansible:latest + environment: + SSH_PRIVATE_KEY: + from_secret: SSH_PRIVATE_KEY commands: + - mkdir -p ~/.ssh + - echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa - ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/apply.yml when: branch: master diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index a15eb28..9403f44 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1,9 +1,8 @@ --- # Global variables for rsyslog configuration management -# Deployment configuration -deploy_user: root -deploy_host: "REPLACE_ME" +# Ansible connection settings +ansible_user: root ansible_ssh_private_key_file: "~/.ssh/id_rsa" ansible_ssh_common_args: "-o StrictHostKeyChecking=no" diff --git a/ansible/inventory/hosts.yml b/ansible/inventory/hosts.yml index 6154600..90bbcc5 100644 --- a/ansible/inventory/hosts.yml +++ b/ansible/inventory/hosts.yml @@ -1,9 +1,12 @@ +--- all: children: rsyslog_servers: hosts: - rsyslog-server: - ansible_host: "{{ deploy_host }}" - ansible_user: "{{ deploy_user }}" - ansible_ssh_private_key_file: "{{ ansible_ssh_private_key_file }}" - ansible_ssh_common_args: "{{ ansible_ssh_common_args }}" + rsyslog-lab: + ansible_host: 192.168.10.161 + # Future servers can be added here: + # rsyslog-prod: + # ansible_host: 192.168.10.162 + # rsyslog-backup: + # ansible_host: 192.168.10.163