Commit 7b8ada51 by Kevin Falcone

We have users in our lists who are absent and keyless

We don't always want to immediately remove them, as we use these configs
to pull them off of other hosts.
parent 92acf889
......@@ -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