diff --git a/playbooks/getting_started/clone-repository.yml b/playbooks/getting_started/clone-repository.yml index f2bf6a4..723fb01 100644 --- a/playbooks/getting_started/clone-repository.yml +++ b/playbooks/getting_started/clone-repository.yml @@ -18,11 +18,6 @@ path: "{{ ssh_auto_sshadd_file }}" register: auto_sshadd_stat - - name: Check if repo exists - stat: - path: "{{ git_repo_path }}" - register: repo_dir_stat - - name: Prepare auto ssh-add file register: prepareAutoSshAdd ansible.builtin.shell: | @@ -31,31 +26,16 @@ chmod +x {{ ssh_auto_sshadd_file }} when: not auto_sshadd_stat.stat.exists - - name: Load SSH key - register: loadingSshKey + - name: Clone and Update Repository + register: clonerepo ansible.builtin.shell: | eval `ssh-agent -s` SSH_PASS={{ssh_passphrase}} DISPLAY=1 SSH_ASKPASS="{{ssh_auto_sshadd_file}}" ssh-add {{ssh_keyfile}} < /dev/null - - name: Display ssh key loading output - debug: - msg: "{{loadingSshKey.stdout_lines}}" - - - name: Clone a develop branch - register: clonerepo - ansible.builtin.shell: | git clone ssh://git@bitbucket.gad.local:7999/nm-nsp/{{git_repo_path}}.git {{git_repo_path}} - when: not auto_sshadd_stat.stat.exists - - name: Display cloning output - debug: - msg: "{{clonerepo.stdout_lines}}" - - - name: Checkout and update branch - register: updaterepo - ansible.builtin.shell: | cd nwl-ci git checkout develop git fetch -ap git pull - - name: Display repo update output + - name: Display ssh key loading output debug: - msg: "{{updaterepo.stdout_lines}}" + msg: "{{clonerepo.stdout_lines}}"