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

Add Ansible playbook for AVR setup #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

syclops
Copy link

@syclops syclops commented May 6, 2021

Add an Ansible playbook which installs the necessary AVR libraries using
apt and pip, and copies the AVRDUDE configuration to the user's home
directory. Also add corresponding instructions in the README for how to
run the Ansible playbook.

Using an Ansible playbook is useful for two reasons: (1) it is
idempotent, which means that it can be run multiple times without
repeating unnecessary steps (and potentially breaking some
configurations), and (2) it can be easily modified to run on remote
machines, which may be helpful in the future.

The current Ansible playbook can only run locally, and must be run from
the repository root directory. If necessary, this can be modified in the
future.

Add an Ansible playbook which installs the necessary AVR libraries using
apt and pip, and copies the AVRDUDE configuration to the user's home
directory. Also add corresponding instructions in the README for how to
run the Ansible playbook.

Using an Ansible playbook is useful for two reasons: (1) it is
idempotent, which means that it can be run multiple times without
repeating unnecessary steps (and potentially breaking some
configurations), and (2) it can be easily modified to run on remote
machines, which may be helpful in the future.

The current Ansible playbook can only run locally, and must be run from
the repository root directory. If necessary, this can be modified in the
future.
Copy link
Contributor

@mpatil99 mpatil99 left a comment

Choose a reason for hiding this comment

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

Looks good to me.
@jackiezeng01 @wsh32 or @jack-greenberg Could one of y'all glance over this real quick before we merge it in?

@jack-greenberg
Copy link
Contributor

I don't know enough about ansible to give a proper review, but looks simple enough. I guess my main question is "what is the advantage of using ansible over just a bash setup script?" It seems like we're only installing a few things using apt, so it seems easy enough to either automate or just have people paste in commands? Not a blocking question, so it's fine with me to merge, this is more of a question for my own personal knowledge.

@syclops
Copy link
Author

syclops commented May 7, 2021

I guess my main question is "what is the advantage of using ansible over just a bash setup script?" It seems like we're only installing a few things using apt, so it seems easy enough to either automate or just have people paste in commands?

In this case, there isn't one, since the assumption with the bash scripts is that people are going to clone the repo to their machines and then run the scripts themselves. It's helpful if you ever anticipate the setup becoming more complex in the future, because the configuration-as-code setup means you can make edits to the playbook and everyone else still runs the same command.

Also, if you ever anticipate needing to run setup on remote machines (e.g., set up a cloud server and do the setup there), you can use Ansible (with a bit of modification) to run the setup remotely, as long as that remote machine has SSH and Python.

@jack-greenberg
Copy link
Contributor

I'm definitely on board. My main concern is that adding another tool means:

  1. Another possibility for something to go wrong and
  2. Another tool that will have to be maintained, taught/learned, and updated

I'm not as concerned about 1, but 2 is a biggie. Can there be some associated documentation on Confluence and comments in the yaml files that detail what things mean and why they are there?

One good use case for me specifically will be installing Bazel, as I'm working on integrating it for our new build system. If there is documentation that I can refer to for adding Bazel to ansible so that I can try it, that'd be great!

@syclops
Copy link
Author

syclops commented May 10, 2021

Can there be some associated documentation on Confluence and comments in the yaml files that detail what things mean and why they are there?

Sure, I'm happy to do this. I don't know if there's a way to make changes to Confluence part of this PR, but if not, I'm happy to go ahead and add more comments to the .yml file.

We can also chat in real time about more use cases to make sure we're on the same page.

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.

3 participants