From a80dad2bdc568ab92abaa4d78394dd51b715a51a Mon Sep 17 00:00:00 2001 From: rulrich Date: Tue, 12 Mar 2024 09:30:51 +0100 Subject: [PATCH] .drone.yml aktualisiert --- .drone.yml | 70 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 75006df..806a7e8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,17 +31,17 @@ steps: # requirements: requirements.txt # galaxy: requirements.yml syntax_check: true -# when: -# event: -# - pull_request + when: + event: + - pull_request - name: Lint image: cytopia/ansible-lint commands: - ansible-lint playbook.yml --force-color -# when: -# event: -# - pull_request + when: + event: + - pull_request - name: Show Diff and Check image: plugins/ansible:3 @@ -59,22 +59,46 @@ steps: ssh_extra_args: "-o StrictHostKeyChecking=no" # requirements: requirements.txt # galaxy: requirements.yml -# when: -# event: -# - pull_request + when: + event: + - pull_request -- name: webhook-pr - image: plugins/webhook +# - name: webhook-pr +# image: plugins/webhook +# settings: +# username: +# from_secret: mattermost_username +# password: +# from_secret: mattermost_password +# urls: https://chat.host-ranger.ch/hooks/9e39cidaqt8d7f9hd4gmutkngr +# content_type: application/json +# template: | +# { +# "owner": "$DRONE_REPO_OWNER", +# "repo": "$DRONE_REPO_NAME", +# "status": "$DRONE_BUILD_STATUS" +# } + +- name: Apply Playbook + image: plugins/ansible settings: - username: - from_secret: mattermost_username - password: - from_secret: mattermost_password - urls: https://chat.host-ranger.ch/hooks/9e39cidaqt8d7f9hd4gmutkngr - content_type: application/json - template: | - { - "owner": "$DRONE_REPO_OWNER", - "repo": "$DRONE_REPO_NAME", - "status": "$DRONE_BUILD_STATUS" - } \ No newline at end of file + become: true + playbook: playbook.yml + inventory: hosts + limit: testing + user: + from_secret: drone_ansible_user + private_key: + from_secret: drone_ansible_ssh_private_key + diff: true + check: true + ssh_extra_args: "-o StrictHostKeyChecking=no" +# requirements: requirements.txt +# galaxy: requirements.yml + diff: true + when: + branch: + - main + event: + - push + - tag \ No newline at end of file