New Slack stuff.

This commit is contained in:
Robert de Bock 2020-05-19 18:57:48 +02:00
parent 9596725b9e
commit 3f67049f38
5 changed files with 34 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.swp *.swp
secure.yml

View File

@ -16,6 +16,7 @@ This script loads input from:
- molecule/default/playbook.yml* - molecule/default/playbook.yml*
- molecule/default/verify.yml - molecule/default/verify.yml
- generate_modules.sh - generate_modules.sh
- secure.yml
- Ansible Galaxy - Ansible Galaxy
(Items with a star are mandatory) (Items with a star are mandatory)
@ -69,6 +70,15 @@ author: Robert de Bock (robert@meinit.nl)
author_website: "https://robertdebock.nl/" author_website: "https://robertdebock.nl/"
``` ```
## secure.yml
This file contains a secret unique to you; te slack encryption token. You have to create this file yourself and it should contain:
```yaml
---
slack_token: "YOUR_SLACK_USERNAME:YOUR_SLACK_TOKEN"
```
## meta/version.yml ## meta/version.yml
This optional file can be placed when a role contains a version. This optional file can be placed when a role contains a version.

2
ansible.cfg Normal file
View File

@ -0,0 +1,2 @@
[defaults]
vault_password_file=vault_password_file.txt

View File

@ -125,6 +125,26 @@
file: "{{ role_path }}/.travis.yml" file: "{{ role_path }}/.travis.yml"
name: travis name: travis
- name: load secure.yml
include_vars:
file: secure.yml
name: secure
- name: generate secure hash
command: /usr/bin/travis encrypt --pro {{ secure.slack_token }} --no-interactive
register: travis_secure
when:
- travis.notifications.slack.secure | length < 512
- name: overwrite travis.notifications.slack.secure
set_fact:
travis:
notifications:
slack:
secure: "{{ travis_secure.stdout }}"
when:
travis_secure.stdout is defined
- name: create .github directory - name: create .github directory
file: file:
path: "{{ role_path }}/.github" path: "{{ role_path }}/.github"

View File

@ -37,5 +37,5 @@ script:
notifications: notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/ webhooks: https://galaxy.ansible.com/api/v1/notifications/
slack: slack:
secure: "{{ travis.notifications.slack.secure }}" secure: {{ travis.notifications.slack.secure }}
email: false email: false