Proxy all gitlab CI attempts through a bastion box
This commit is contained in:
parent
e9bf120509
commit
4a73e8782f
@ -1,4 +1,6 @@
|
|||||||
image: rehashedsalt/ansible-env:bleeding
|
image: rehashedsalt/ansible-env:bleeding
|
||||||
|
variables:
|
||||||
|
SSH_BASTION_ARGS: '-o "ProxyCommand=ssh -W %h:%p -q ansible@bastion1.dallas.mgmt.desu.ltd"'
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- lint
|
||||||
- test
|
- test
|
||||||
@ -48,20 +50,20 @@ Test:
|
|||||||
except:
|
except:
|
||||||
- pipelines
|
- pipelines
|
||||||
script:
|
script:
|
||||||
- ansible-playbook --skip-tags no-test -C site.yml --vault-password-file /vaultpw || error="$?"
|
- ansible-playbook --skip-tags no-test -C site.yml --ssh-common-args="$SSH_BASTION_ARGS" --vault-password-file /vaultpw || error="$?"
|
||||||
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
||||||
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
||||||
|
|
||||||
Play_Against_Remote:
|
Play_Against_Remote:
|
||||||
stage: play
|
stage: play
|
||||||
script:
|
script:
|
||||||
- ansible-playbook -l '!tags_home' site.yml --vault-password-file /vaultpw || error="$?"
|
- ansible-playbook -l '!tags_home' site.yml --ssh-common-args="$SSH_BASTION_ARGS" --vault-password-file /vaultpw || error="$?"
|
||||||
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
||||||
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
||||||
Play_Against_Home:
|
Play_Against_Home:
|
||||||
stage: play
|
stage: play
|
||||||
retry: 1
|
retry: 1
|
||||||
script:
|
script:
|
||||||
- ansible-playbook -l tags_home site.yml --vault-password-file /vaultpw || error="$?"
|
- ansible-playbook -l tags_home site.yml --ssh-common-args="$SSH_BASTION_ARGS" --vault-password-file /vaultpw || error="$?"
|
||||||
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
|
||||||
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
|
||||||
|
Loading…
Reference in New Issue
Block a user