updated maintenance scripts
diff --git a/setup-base.yml b/setup-base.yml index 3ac5fdb..0ac48c6 100644 --- a/setup-base.yml +++ b/setup-base.yml
@@ -26,7 +26,6 @@ - name: Git checkout of playbook repositories tags: ['playbooks'] become: false - ignore_errors: yes git: repo: '{{ repository_secure_endpoint_ssh }}/{{ item.repo_name }}.git' dest: "{{ item.workspace }}/{{ item.repo_name }}" @@ -36,11 +35,12 @@ - name: Git checkout of role repositories tags: ['roles'] become: false - ignore_errors: yes git: repo: '{{ repository_secure_endpoint_ssh }}/{{ item.repo_name }}.git' dest: "{{ item.workspace }}/{{ item.repo_name }}" accept_hostkey: yes + update: yes + version: master with_items: "{{ role_repos }}" when: role_repos is defined
diff --git a/update-git-remote-origin.yml b/update-git-remote-origin.yml index fed5e33..b13e2b2 100644 --- a/update-git-remote-origin.yml +++ b/update-git-remote-origin.yml
@@ -10,7 +10,8 @@ tasks: - - name: Remove existing origin repo + - name: Remove existing origin repo for playbooks + tags: ['remove'] shell: "git remote remove origin" args: chdir: "{{ item.workspace }}/{{ item.repo_name }}" @@ -19,9 +20,28 @@ - "{{ role_repos }}" - name: Add updated origin repo + tags: ['add'] shell: "git remote add origin {{ repository_secure_endpoint_ssh }}/{{ item.repo_name }}.git" args: chdir: "{{ item.workspace }}/{{ item.repo_name }}" with_items: - "{{ playbook_repos }}" - "{{ role_repos }}" + + - name: Associate to upstream master branch + tags: ['associate'] + shell: "git branch --set-upstream-to=origin/master master" + args: + chdir: "{{ item.workspace }}/{{ item.repo_name }}" + with_items: + - "{{ playbook_repos }}" + - "{{ role_repos }}" + + - name: Pull from updated origin repo + tags: ['pull'] + shell: "git pull" + args: + chdir: "{{ item.workspace }}/{{ item.repo_name }}" + with_items: + - "{{ playbook_repos }}" + - "{{ role_repos }}"