diff --git a/.github/workflows/infrastructure.yml b/.github/workflows/infrastructure.yml index be07b2a6e..f93ce766d 100644 --- a/.github/workflows/infrastructure.yml +++ b/.github/workflows/infrastructure.yml @@ -131,6 +131,15 @@ jobs: - name: Configure Control Machine run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + cat <> ~/.ssh/config + Host * + ControlMaster auto + ControlPath /tmp/ssh_mux_%h_%p_%r + ControlPersist 10m + EOF + ANSIBLE_USER="${USER}" ANSIBLE_CONNECTION="ansible_connection=local" if [ "${IS_MANUAL_DEPLOYMENT}" == "true" ]; then @@ -138,9 +147,7 @@ jobs: ANSIBLE_CONNECTION="" export ANSIBLE_HOST_KEY_CHECKING=false - mkdir -p ~/.ssh && \ - chmod 700 ~/.ssh && \ - echo "${{ secrets.INFRASTRUCTURE_DEPLOYMENT_KEY }}" > ~/.ssh/id_ed25519 && \ + echo "${{ secrets.INFRASTRUCTURE_DEPLOYMENT_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 fi diff --git a/infrastructure/nomad/ansible.cfg.example b/infrastructure/nomad/ansible.cfg.example index 148df3252..ca3b403da 100644 --- a/infrastructure/nomad/ansible.cfg.example +++ b/infrastructure/nomad/ansible.cfg.example @@ -8,7 +8,6 @@ timeout = 10 connection = ssh pipelining = True host_key_checking = False -ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes fact_caching = jsonfile fact_caching_connection = /tmp/ansible_facts_cache fact_caching_timeout = 86400 @@ -17,3 +16,6 @@ module_defaults: gather_subset: - '!all' - 'min' + +[ssh_connection] +ssh_args = -o ControlMaster=auto -o ControlPersist=60m -o ControlPath=/tmp/ssh_mux_%h_%p_%r -o ForwardAgent=yes