playbooks/clone-repo: refactored the playbook
removed the logs to increase the security Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
15732a2cf7
commit
8b56069a38
|
|
@ -1,6 +1,6 @@
|
||||||
- name: Clone a Git Repository
|
- name: Clone a Git Repository
|
||||||
hosts: linux
|
hosts: linux
|
||||||
gather_facts: no
|
gather_facts: false
|
||||||
vars:
|
vars:
|
||||||
git_repo_path: "~/nwl-ci"
|
git_repo_path: "~/nwl-ci"
|
||||||
ssh_auto_sshadd_file: "./auto-sshadd"
|
ssh_auto_sshadd_file: "./auto-sshadd"
|
||||||
|
|
@ -19,23 +19,20 @@
|
||||||
register: auto_sshadd_stat
|
register: auto_sshadd_stat
|
||||||
|
|
||||||
- name: Prepare auto ssh-add file
|
- name: Prepare auto ssh-add file
|
||||||
register: prepareAutoSshAdd
|
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
echo '#!/bin/bash' > {{ ssh_auto_sshadd_file }}
|
echo '#!/bin/bash' > {{ ssh_auto_sshadd_file }}
|
||||||
echo 'echo $SSH_PASS' >> {{ ssh_auto_sshadd_file }}
|
echo 'echo $SSH_PASS' >> {{ ssh_auto_sshadd_file }}
|
||||||
chmod +x {{ ssh_auto_sshadd_file }}
|
chmod +x {{ ssh_auto_sshadd_file }}
|
||||||
|
no_log: true
|
||||||
when: not auto_sshadd_stat.stat.exists
|
when: not auto_sshadd_stat.stat.exists
|
||||||
|
|
||||||
- name: Clone and Update Repository
|
- name: Clone and Update Repository
|
||||||
register: clonerepo
|
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
eval `ssh-agent -s`
|
eval `ssh-agent -s`
|
||||||
SSH_PASS={{ssh_passphrase}} DISPLAY=1 SSH_ASKPASS="{{ssh_auto_sshadd_file}}" ssh-add {{ssh_keyfile}} < /dev/null
|
SSH_PASS={{ssh_passphrase}} DISPLAY=1 SSH_ASKPASS="{{ssh_auto_sshadd_file}}" ssh-add {{ssh_keyfile}} < /dev/null
|
||||||
git clone ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git {{git_repo_path}}
|
git clone ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git {{git_repo_path}}
|
||||||
cd nwl-ci
|
cd {{git_repo_path}}
|
||||||
git checkout develop
|
git checkout develop
|
||||||
git fetch -ap
|
git fetch -ap
|
||||||
git pull
|
git pull
|
||||||
- name: Display ssh key loading output
|
no_log: true
|
||||||
debug:
|
|
||||||
msg: "{{clonerepo.stdout_lines}}"
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue