test-proj/.woodpecker.yml

29 lines
803 B
YAML
Raw Normal View History

2023-03-08 22:52:10 +00:00
pipeline:
2023-03-09 15:44:23 +00:00
test:
2023-03-09 16:35:15 +00:00
image: alpine:latest
2023-03-09 15:44:23 +00:00
secrets: [ ssh_key ]
environment:
- ANSIBLE_PRIVATE_KEY=$SSH_KEY
2023-03-09 15:46:59 +00:00
- ANSIBLE_HOST_KEY_CHECKING=False
2023-03-09 15:44:23 +00:00
commands:
2023-03-09 15:56:14 +00:00
# - apt-get update && apt-get install ansible -y
2023-03-09 16:35:15 +00:00
# - apt-get update && apt-get install file -y
- printf "$SSH_KEY" > /tmp/privateKey
2023-03-09 15:50:08 +00:00
- chmod 600 /tmp/privateKey
2023-03-09 15:56:14 +00:00
- sha256sum /tmp/privateKey
2023-03-09 16:04:46 +00:00
- cat /tmp/privateKey
2023-03-09 16:07:23 +00:00
- file /tmp/privateKey
2023-03-09 16:16:41 +00:00
- wc -l /tmp/privateKey
2023-03-09 16:35:15 +00:00
# - ansible-playbook --user igor --inventory hosts.ini --private-key /tmp/privateKey main.yml
2023-03-09 15:44:23 +00:00
2023-03-09 02:20:45 +00:00
publish:
image: plugins/ansible
2023-03-09 15:21:56 +00:00
pull: true
2023-03-09 02:20:45 +00:00
secrets: [ ssh_key ]
settings:
2023-03-09 02:22:19 +00:00
playbook: main.yml
2023-03-09 02:20:45 +00:00
inventory: hosts.ini
2023-03-09 14:56:32 +00:00
connection: paramiko_ssh
2023-03-09 02:20:45 +00:00
user: igor
2023-03-09 15:14:04 +00:00
private_key: $SSH_KEY