Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust which playbook is run depending on which group was changed #5

Merged
merged 5 commits into from Oct 7, 2015

Conversation

pypingou
Copy link
Member

@pypingou pypingou commented Oct 6, 2015

No description provided.

@pypingou
Copy link
Member Author

pypingou commented Oct 6, 2015

This hasn't had much testing :(

@ralphbean
Copy link
Contributor

I don't understand. What is the difference between the two playbooks?

Also, will this fail on some of the message types? Do any of them have an odd group field? See https://apps.fedoraproject.org/datagrepper/raw?topic=org.fedoraproject.prod.fas.role.update&topic=org.fedoraproject.prod.fas.group.member.sponsor&topic=org.fedoraproject.prod.fas.group.member.remove&topic=org.fedoraproject.prod.fas.user.update for a query.

@pypingou
Copy link
Member Author

pypingou commented Oct 6, 2015

I don't understand. What is the difference between the two playbooks?

run_fasClient.yml runs on all our hosts but some that do not have fasClient, while run_fasClient_simple.yml only runs on some of the hosts (fedorapeople, fedorahosted, bastion, pkgs)

groups = [
msg['msg']['group']
for msg in messages
if 'sysadmin-' in msg['msg'].get('group', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just 'sysadmin' instead of 'sysadmin-'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if there are groups having sysadmin in their name but not related to us (I'm thinking a foosysadmingit or so.

@ralphbean
Copy link
Contributor

So this has us doing simple by default. But the more complete one when the change is with respect to a group.

This deserves an inline comment to explain. Why is it more complex when there's a group involved? What kind of change happened that deserves only a simple run when there is no group involved.

Is it that the simple runs take place only when a public SSH key changes?

What about if a sysadmin with shell access changes their SSH key? That info won't get propagated to all the nodes.

@pypingou
Copy link
Member Author

pypingou commented Oct 6, 2015

  • fas.group.member.sponsor has a group
  • fas.user.update has no group
  • fas.group.member.remove has a group
  • fas.role.update has a group

So fas.user.update is the only one giving us problem :-/

@pypingou
Copy link
Member Author

pypingou commented Oct 6, 2015

What about if a sysadmin with shell access changes their SSH key? That info won't get propagated to all the nodes.

Looking into the data for my previous reply I was thinking about this and maybe we should look into the message for fas.user.update and use the global playbook if the user updated their ssh key.

Thoughts?

@pypingou
Copy link
Member Author

pypingou commented Oct 6, 2015

Why is it more complex when there's a group involved? What kind of change happened that deserves only a simple run when there is no group involved.

It's not about having groups involved, it's about which groups are involved :)

for msg in messages:
# If one of the groups includes a sysadmin-related group, run the
# complete playbook
if 'sysadmin-' in msg['msg'].get('group', None) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave the '-' off the end of 'sysadmin-' so we can catch the "sysadmin" group itself?

- Let's be more generous about which group we find
- Don't forget that None is not iterable so use an empty string instead
@ralphbean
Copy link
Contributor

Nice! 👍

pypingou added a commit that referenced this pull request Oct 7, 2015
Adjust which playbook is run depending on which group was changed
@pypingou pypingou merged commit 33adf94 into master Oct 7, 2015
@pypingou pypingou deleted the separate_playbook branch October 7, 2015 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants