parent
1a9ed6fc06
commit
c207eb99ac
@ -1,28 +1,32 @@
|
|||||||
steps:
|
steps:
|
||||||
syntax-check:
|
syntax-check:
|
||||||
image: alpine/ansible:latest
|
image: alpine/ansible:latest
|
||||||
|
environment:
|
||||||
|
ANSIBLE_CONFIG: ansible.cfg
|
||||||
commands:
|
commands:
|
||||||
- ansible-playbook -i ansible/inventory/hosts.yml --syntax-check ansible/playbooks/*.yml
|
- ansible-playbook -i ansible/inventory/hosts.yml --syntax-check ansible/playbooks/*.yml
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
image: alpine/ansible:latest
|
image: alpine/ansible:latest
|
||||||
environment:
|
environment:
|
||||||
|
ANSIBLE_CONFIG: ansible.cfg
|
||||||
SSH_PRIVATE_KEY:
|
SSH_PRIVATE_KEY:
|
||||||
from_secret: SSH_PRIVATE_KEY
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
|
- echo "$${SSH_PRIVATE_KEY}" | base64 -d > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.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: alpine/ansible:latest
|
image: alpine/ansible:latest
|
||||||
environment:
|
environment:
|
||||||
|
ANSIBLE_CONFIG: ansible.cfg
|
||||||
SSH_PRIVATE_KEY:
|
SSH_PRIVATE_KEY:
|
||||||
from_secret: SSH_PRIVATE_KEY
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
|
- echo "$${SSH_PRIVATE_KEY}" | base64 -d > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.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:
|
||||||
@ -31,11 +35,12 @@ steps:
|
|||||||
deploy:
|
deploy:
|
||||||
image: alpine/ansible:latest
|
image: alpine/ansible:latest
|
||||||
environment:
|
environment:
|
||||||
|
ANSIBLE_CONFIG: ansible.cfg
|
||||||
SSH_PRIVATE_KEY:
|
SSH_PRIVATE_KEY:
|
||||||
from_secret: SSH_PRIVATE_KEY
|
from_secret: SSH_PRIVATE_KEY
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
|
- echo "$${SSH_PRIVATE_KEY}" | base64 -d > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user