From 1d6192debf56809de09b8dfffdef3a7e489db548 Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 20 Jun 2021 20:25:47 -0500 Subject: [PATCH] Fix things in the docker spin-up script --- contrib/docker.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/docker.sh b/contrib/docker.sh index d698efa..6dfd008 100755 --- a/contrib/docker.sh +++ b/contrib/docker.sh @@ -20,6 +20,7 @@ if [ -n "$ANSIBLE_SSH_KEY" ]; then mkdir /etc/sudoers.d echo 'ansible ALL=(ALL:ALL) NOPASSWD:ALL' > /etc/sudoers.d/50-playbookuser # And owns their home + mkdir -p /home/ansible chown ansible. ~ansible # Dump the private key as fast as possible to reduce leak @@ -31,7 +32,7 @@ if [ -n "$ANSIBLE_SSH_KEY" ]; then chown ansible. ~ansible/.ssh/desu # Give the ansible user a managable profile - cp /etc/ansible/roles/common/templates/profile.sh /etc/profile.d/50-ansible.sh + cp /etc/ansible.orig/roles/common/templates/profile.sh /etc/profile.d/50-ansible.sh # Install the packages we need to test things in the repo printf '\e[37mUpdating repositories...\e[0m\n' @@ -45,9 +46,10 @@ if [ -n "$ANSIBLE_SSH_KEY" ]; then printf '\e[37mCreating local copy of playbook files...\e[0m\n' mkdir /etc/ansible chown ansible. /etc/ansible - sudo -u ansible rsync -aHS /etc/ansible.orig /etc/ansible --exclude .git + sudo -u ansible rsync -aHS /etc/ansible.orig/ /etc/ansible/ --exclude .git printf '\e[37mInstalling roles...\e[0m\n' sudo -u ansible ansible-galaxy install -r roles/requirements.yml -p roles + cd /etc/ansible # Drop to the ansible user printf '\e[32mAnsible is ready to run\e[0m\n' @@ -64,4 +66,4 @@ docker run -it \ -e "ANSIBLE_SSH_KEY=$ANSIBLE_SSH_KEY" \ -v "$PWD:/etc/ansible.orig:ro" \ ubuntu:focal \ - bash -c 'cd /etc/ansible && ./contrib/docker.sh && exec bash' + bash -c 'cd /etc/ansible.orig && ./contrib/docker.sh'