From 2e7bdc47d7ff293f74d739d60a2d3b377b9fd3d8 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Fri, 6 Sep 2024 12:16:26 -0700 Subject: [PATCH] Move some Ansible config out of scripts and into `ansible.cfg` My immediate motivation is that I'm going to try turning on the pipelining setting, to improve performance, and I'd like to have the consistent place to put it! But also, I like standardizing our setup a bit more, too --- bin/deploy:push | 2 +- bin/deploy:setup | 2 +- deploy/ansible.cfg | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 deploy/ansible.cfg diff --git a/bin/deploy:push b/bin/deploy:push index 81384d5e..bc0655e4 100755 --- a/bin/deploy:push +++ b/bin/deploy:push @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Deploy a new version to production, using the Ansible playbook in `deploy/deploy.yml`. # This skips the build step that normally runs when you just call `bin/deploy`. -ansible-playbook -i deploy/inventory.cfg deploy/deploy.yml +cd $(dirname $0)/../deploy && ansible-playbook deploy.yml diff --git a/bin/deploy:setup b/bin/deploy:setup index 70177f69..303de75a 100755 --- a/bin/deploy:setup +++ b/bin/deploy:setup @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Set up the deployment environment, using the Ansible playbook in `deploy/setup.yml`. echo $'Setup requires you to become the root user. You\'ll need to enter the password for your account on the remote web server below, and you must be part of the `sudo` user group.' -ansible-playbook -K -i deploy/inventory.cfg deploy/setup.yml +cd $(dirname $0)/../deploy && ansible-playbook -K setup.yml diff --git a/deploy/ansible.cfg b/deploy/ansible.cfg new file mode 100644 index 00000000..e9fa9c2c --- /dev/null +++ b/deploy/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +inventory = inventory.cfg