| --- |
| - hosts: localhost |
| connection: local |
| vars_files: |
| - repository-mapping-name-folder.yml |
| - repository-custom-properties.yml |
| |
| tasks: |
| - name: Ensure ansible configuration folders exist |
| file: |
| path: '{{ item }}' |
| state: directory |
| with_items: '{{ configuration_folders }}' |
| tags: ['config'] |
| |
| - block: |
| - name: Git checkout of configuration repositories |
| tags: ['config'] |
| become: false |
| git: |
| repo: '{{ repository_secure_endpoint_ssh }}/{{ item.repo_name }}.git' |
| dest: "{{ item.workspace }}/{{ item.repo_name }}" |
| accept_hostkey: yes |
| with_items: "{{ config_repos }}" |
| |
| - name: Git checkout of playbook repositories |
| tags: ['playbooks'] |
| become: false |
| git: |
| repo: '{{ repository_secure_endpoint_ssh }}/{{ item.repo_name }}.git' |
| dest: "{{ item.workspace }}/{{ item.repo_name }}" |
| accept_hostkey: yes |
| with_items: "{{ playbook_repos }}" |
| |
| - name: Git checkout of role repositories |
| tags: ['roles'] |
| become: false |
| 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 |
| when: checkout_type | default('ssh') | trim == 'ssh' |
| |
| - block: |
| - name: Git checkout of configuration repositories |
| tags: ['config'] |
| become: false |
| ignore_errors: yes |
| git: |
| repo: '{{ repository_secure_endpoint_https }}/{{ item.repo_name }}.git' |
| dest: "{{ item.workspace }}/{{ item.repo_name }}" |
| accept_hostkey: yes |
| with_items: "{{ config_repos }}" |
| |
| - name: Git checkout of playbook repositories |
| tags: ['playbooks'] |
| become: false |
| git: |
| repo: '{{ repository_secure_endpoint_https }}/{{ item.repo_name }}.git' |
| dest: "{{ item.workspace }}/{{ item.repo_name }}" |
| accept_hostkey: yes |
| with_items: "{{ playbook_repos }}" |
| |
| - name: Git checkout of role repositories |
| tags: ['roles'] |
| become: false |
| git: |
| repo: '{{ repository_secure_endpoint_https }}/{{ 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 |
| when: checkout_type is defined and checkout_type | trim == 'https' |
| |
| - name: Add empty credentials.yml file to .apigee |
| copy: |
| src: resources/credentials.yml |
| dest: '{{ apigee_security }}/credentials.yml' |
| force: no |