parent
cb8d885061
commit
227fb86b04
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user