Commit 192ce8d6 by Kevin Falcone Committed by GitHub

Merge pull request #3160 from edx/jibsheet/protect-ssh-key-checking

We have users who are absent and keyless
parents 2e24a982 7b8ada51
......@@ -116,13 +116,16 @@
- name: Check the ssh key(s) for user(s) over github
uri:
url: "https://github.com/{{ item.name }}.keys"
# We don't care if absent users lack ssh keys
when: item.get('state', 'present') == 'present'
with_items: "{{ user_info }}"
register: github_users_return
- fail:
msg: "User {{ item.item.name }} doesn't have an SSH key associated with their account"
with_items: "{{ github_users_return.results | default([]) }}"
when: item.content_length == "0"
# We skip users in the previous task, and they end up with no content_length
when: item.get('content_length') and item.content_length == "0"
- name: Get github key(s) and update the authorized_keys file
authorized_key:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment