ugh ffs why is this playbook failing now
excuse me Ruby, WTF?
mastodon@animusvox:~/live$ gem install bundler -v 1.16.6
Fetching: bundler-1.16.6.gem (100%)
Successfully installed bundler-1.16.6
Parsing documentation for bundler-1.16.6
Installing ri documentation for bundler-1.16.6
Done installing documentation for bundler after 4 seconds
1 gem installed
Fetching gem metadata from https://rubygems.org/..^Cmastodon@animusvox:~/live$ ^C
also updated Mastible to automatically checkout the latest stable Mastodon version automatically instead of me updating the version manually
the relevant lines, using Ansible register variable functionality to my advantage
@staticsafe From a quick glance, my main advice would be to use variables and blocks to avoid repeating yourself so much, and to use chdir with command instead of `shell: chdir foo && cmd` (if running this under bash is important, you can move the chdir to args and keep shell.) E.g. here's a rewrite of roles/mastodon-config/tasks/install.yml: https://gist.github.com/flowerysong/bc755b1aaace179a96352035811e877b (I'd really move those variables outside this file entirely, but this shows the principle.)
@flowerysong why chdir instead of cd?
thanks for the advice!
@staticsafe Mainly because it doesn't require a shell; secondarily, because it's less cognitive load to read what the tasks are doing. When you have a task like 'shell: cd /home/mastodon/live && bundle exec rake secret' your brain has to do more parsing to find the actual command than with 'shell: bundle exec rake secret', and it makes scanning through the tasks quickly more of a burden.
@loke Because the module argument is `chdir`, not `cd`. Using `cd` as a module argument would be invalid.
If chdir is its own binary, it can't do anything useful. The current directory is local to its processes and children, so if yiu create a binary that simply runs the chdir system call, it cannot affect the current directory of the calling process.
However, scrolling back in the thread it seems this is not actually shellscript, so I'm guessing this is actually an embedded command in the framework in which this is run?
staticsafe's personal Mastodon instance.