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

Idea: Ansible playbook to provision your laptop #5

Closed
xserrat opened this issue Dec 27, 2018 · 3 comments
Closed

Idea: Ansible playbook to provision your laptop #5

xserrat opened this issue Dec 27, 2018 · 3 comments
Labels
question Further information is requested

Comments

@xserrat
Copy link

xserrat commented Dec 27, 2018

Hi @JavierCane and @rgomezcasas,

I've found an Ansible playbook that makes something similar and it could be a way to take advantage of Ansible to provision any machine.

The main repository is this one: https://github.com/geerlingguy/mac-dev-playbook. But this repository uses some roles created by the same author:

I hope it can be useful!

@JavierCane
Copy link
Member

JavierCane commented Dec 28, 2018

Hi @xserrat!

Firstly, thanks a lot for your suggestion, we really appreciate it and it has made us think about how we can evolve this little project 😊

Needs

You're completely right about the need of finding some way to parametrize some configuration such as:

  • Parameters. Example: Name and email to use in the .gitconfig
  • Environment particularities. Example: Path to the project clone in order to be able to create symlinks to its bin/ directory while modifying the $PATH
  • Customize installation. Example: Some users could not be interested into installing the IntelliJ IDE (also avoiding the symlink to its configuration), but just the VSCode one, so the Brewfile should be customizable and taken into account while copying the preferences

Why Ansible couldn't be the best tool

Having that into account, we're not sure about Ansible being the best tool for the job. Concerns about it (please, correct me if I'm wrong in any of these assumptions):

  • We would be forcing the end users to install it locally in order to bootstrap its environment, and keep it installed in order to update any config changes. It's possible that a lot of people don't use Ansible in their day-to-day work, so we would be depending on installing a tool in your computer just in order to maintain its config
  • Adds accidental complexity while understanding this project. If we use Ansible we would be introducing a new set of concepts such as Playbook, Role, Inventory, Modules, Tasks, etc.
    Having to learn all these concepts while just trying to configure your computer could be a barrier in order to use this project because as an end user, we wouldn't be interested into learning a new tool. We would try to make the environment bootstrap as quick as possible.
  • Lose the easiness of discovery through the repository. As an end user, when we look to other dotfile projects in order to learn how to tweak something, or just what can we do, we like to just open the GitHub project and see what that project does. If we introduce Ansible, we would end up with a folder structure talking more about Ansible concepts rather than config files and so on.

Alternative suggestion

So in conclusion, we would prefer to automate it with something simpler. Maybe just a bash script which:

  1. Checks if there's a config.env file at the project root (ignored in Git by default by a .gitignore entry)
  2. If this file doesn't exists, ask the user for each one of the values defined by default in the config.env.dist file, and generate the final config.env with the specified values (these config parameters would be the ones specified in the begining of this comment)
  3. Once we have the config.env generated, it would only have to set them as environment variables, and execute the install tasks
  4. Ask the user for confirmation before executing each one of the install steps
  5. Ask the user to tweet about the tool with something like "I've just used @CodelyTV/dotfiles to setup my computer in a matter of seconds! 🤟🚀" :P

Call to action

What do you think about the script? Would you dare to give it a try in a PR? 😬

tenor-205335316

This is the best gif I found to say "We need you" in a funny and subliminal way 😬

@JavierCane JavierCane added the question Further information is requested label Dec 28, 2018
@JavierCane JavierCane pinned this issue Dec 28, 2018
@xserrat
Copy link
Author

xserrat commented Dec 29, 2018

Thank you @JavierCane for your answer 😬

You're totally right about it.

The need to have Ansible installed and the complexity at the beginning are good reasons to use an alternative way to do it. I've suggested Ansible because when you know how it works (a little bit), it's really easy to create a configuration script without too much effort (thanks to the modules and other stuff).

But it's true that an end user just wants to change some parameters in an easy way, and if the project is as simple as possible, the satisfaction will be better 🥳

So, I'm going to try to create a bash script to do it (I'm not an experienced bash programmer but it's a nice way to learn! 🤓).

Thanks again! 👏👏

@JavierCane
Copy link
Member

That's awesome!!! 😬😬😬

I'll close this issue regarding the Ansible proposal. Free free to open the PR whenever you consider 🙂🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants