parent
cb8d885061
commit
227fb86b04
@ -6,19 +6,37 @@ steps:
|
|||||||
|
|
||||||
validate:
|
validate:
|
||||||
image: ansible/ansible:latest
|
image: ansible/ansible:latest
|
||||||
|
environment:
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
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
|
- ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/validate.yml
|
||||||
|
|
||||||
drift-check:
|
drift-check:
|
||||||
image: ansible/ansible:latest
|
image: ansible/ansible:latest
|
||||||
|
environment:
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
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
|
- ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/drift-check.yml
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
image: ansible/ansible:latest
|
image: ansible/ansible:latest
|
||||||
|
environment:
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
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
|
- ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/apply.yml
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
---
|
---
|
||||||
# Global variables for rsyslog configuration management
|
# Global variables for rsyslog configuration management
|
||||||
|
|
||||||
# Deployment configuration
|
# Ansible connection settings
|
||||||
deploy_user: root
|
ansible_user: root
|
||||||
deploy_host: "REPLACE_ME"
|
|
||||||
ansible_ssh_private_key_file: "~/.ssh/id_rsa"
|
ansible_ssh_private_key_file: "~/.ssh/id_rsa"
|
||||||
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
|
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
|
---
|
||||||
all:
|
all:
|
||||||
children:
|
children:
|
||||||
rsyslog_servers:
|
rsyslog_servers:
|
||||||
hosts:
|
hosts:
|
||||||
rsyslog-server:
|
rsyslog-lab:
|
||||||
ansible_host: "{{ deploy_host }}"
|
ansible_host: 192.168.10.161
|
||||||
ansible_user: "{{ deploy_user }}"
|
# Future servers can be added here:
|
||||||
ansible_ssh_private_key_file: "{{ ansible_ssh_private_key_file }}"
|
# rsyslog-prod:
|
||||||
ansible_ssh_common_args: "{{ ansible_ssh_common_args }}"
|
# ansible_host: 192.168.10.162
|
||||||
|
# rsyslog-backup:
|
||||||
|
# ansible_host: 192.168.10.163
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user