diff --git a/generate.yml b/generate.yml index 1b6531c..1432f62 100755 --- a/generate.yml +++ b/generate.yml @@ -120,28 +120,28 @@ register: galaxy_id changed_when: no - - name: load .travis.yml - include_vars: - file: "{{ role_path }}/.travis.yml" - name: travis - - name: load secure.yml include_vars: file: secure.yml name: secure + - name: load .travis.yml + include_vars: + file: "{{ role_path }}/.travis.yml" + name: travis + - name: generate secure hash - command: "/usr/bin/travis encrypt --pro robertdebock:{{ secure.slack_token }}#builds --no-interactive" + command: "/usr/bin/travis encrypt --pro robertdebock:{{ secure.slack_token }} --no-interactive" register: travis_secure when: - - travis.notifications.slack.secure | length < 512 + - travis.notifications.slack is defined + - travis.notifications.slack | length < 512 - - name: overwrite travis.notifications.slack.secure + - name: overwrite travis.notifications.slack set_fact: travis: notifications: - slack: - secure: "{{ travis_secure.stdout | regex_replace('\"', '') }}" + slack: "{{ travis_secure.stdout | regex_replace('\"', '') }}" when: travis_secure.stdout is defined diff --git a/templates/travis.yml.j2 b/templates/travis.yml.j2 index b401c82..8242694 100644 --- a/templates/travis.yml.j2 +++ b/templates/travis.yml.j2 @@ -36,7 +36,5 @@ script: notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ - slack: - rooms: - - secure: "{{ travis.notifications.slack.secure }}" + slack: "{{ travis.notifications.slack }}" email: false