| --- |
| - hosts: localhost |
| connection: local |
| vars_files: |
| - repository-custom-properties.yml |
| - repository-mapping-name-folder.yml |
| |
| tasks: |
| - name: Ensure ansible configuration folders exist |
| tags: ['config','playbooks','roles'] |
| file: |
| path: '{{ item }}' |
| state: directory |
| with_items: '{{ configuration_folders }}' |
| |
| - name: Update Library |
| synchronize: |
| src: library |
| dest: "{{ ansible_config }}/library" |
| delegate_to: localhost |
| |
| - name: Configure git attributes |
| tags: ['config','playbooks','roles'] |
| git_config: |
| name: "{{ item.name }}" |
| scope: "{{ item.scope }}" |
| value: "{{ item.value }}" |
| with_items: |
| - { name: 'http.sslVerify', scope: 'global', value: 'false' } |
| - { name: 'core.gitProxy', scope: 'global', value: '{{ proxy_url }}' } |
| when: extra_check is defined and extra_check | trim == "yes" and proxy_url is defined and proxy_url | trim | length > 0 |
| |
| - 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-secure |
| tags: ['config','playbooks','roles'] |
| copy: |
| src: resources/credentials.yml |
| dest: '{{ apigee_security }}/credentials.yml' |
| force: no |
| |
| - name: Add empty custom-properties.yml file to .apigee |
| tags: ['config','playbooks','roles'] |
| copy: |
| src: resources/custom-properties.yml |
| dest: '{{ apigee_config }}/custom-properties.yml' |
| force: no |