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

ansible-bruno could update wrong profile #49

Open
pfuntner opened this issue Nov 14, 2019 · 1 comment
Open

ansible-bruno could update wrong profile #49

pfuntner opened this issue Nov 14, 2019 · 1 comment

Comments

@pfuntner
Copy link
Owner

While making a change to ansible/bruno.yaml, I realized that the steps to figure out which profile to update could end up with the wrong file if there is more than one potential file.

From the man page:

... (bash) looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

The playbook does indeed look for the files in that order but if the target system has both .bash_profile and .bash_login, the playbook will decide to use .bash_login because will only remember the last file it looked for. The playbook probably needs to be changed to:

  • Maintain the order of step execution but skip steps once a file is found (probably requires a default value of an empty string) - this is probably more like how bash really works
  • Reverse to order of step execution so .bash_profile can override the other two files, etc.

Test scenario

  1. Spin up a virtual machine for the target
  2. Create .bash_profile and .bash_login on the target
  3. Use ansible-bruno command the target
  4. Analyze the playbook output and/or examine the profiles and determine which got updated
@pfuntner
Copy link
Owner Author

I forgot all about this playbook and have not been using it. I'm not sure it's worth pursuing.

FWIW, ansible-tools installs my toys repo and does much of the same setup as bruno.yml.

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

No branches or pull requests

1 participant