Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| --- | |
| - name: Project Bootstrap | |
| hosts: all | |
| tasks: | |
| - name: Locate oc client | |
| find: | |
| paths: "{{ ansible_env['PATH'].split(':') }}" | |
| patterns: 'oc' | |
| register: oc_cmd | |
| - set_fact: | |
| oc_path: "{{ oc_cmd.files[0]['path'] }}" | |
| when: oc_cmd.matched != 0 | |
| - set_fact: | |
| enable_dockercfg_workaround: True | |
| when: oc_cmd.matched == 0 | |
| - name: Bugzilla 1531511, 1476330, Github 18062 Workaround | |
| block: | |
| - name: Download Origin v3.6.1 client | |
| get_url: | |
| url: "{{ oc_url }}" | |
| dest: "{{ oc_extract_dest }}/oc-client.tar" | |
| - name: Extract oc | |
| unarchive: | |
| src: "{{ oc_extract_dest }}/oc-client.tar" | |
| dest: "{{ oc_extract_dest }}" | |
| extra_opts: | |
| - "--strip-components=1" | |
| delegate_to: localhost | |
| when: enable_dockercfg_workaround | |
| run_once: True | |
| - set_fact: | |
| oc_path: "{{ oc_extract_dest }}/oc" | |
| when: enable_dockercfg_workaround | |
| - name: Get User Token | |
| uri: | |
| url: "https://{{ clusterhost }}/oauth/authorize?response_type=token&client_id=openshift-challenging-client" | |
| user: "{{ openshift_username }}" | |
| password: "{{ openshift_password }}" | |
| validate_certs: "{{ validate_certs }}" | |
| force_basic_auth: True | |
| register: login | |
| when: token is undefined | |
| - name: user token | |
| set_fact: | |
| token: "{{ (login.url | regex_search('access_token=([\\d\\w\\-_]*)')).split('=')[1] }}" | |
| when: token is undefined | |
| - name: Create Project | |
| command: >- | |
| {{ oc }} --config=/dev/null new-project {{ project_name }} | |
| --display-name='{{ project_display_name }}' | |
| --description='{{ project_description }}' | |
| ignore_errors: True | |
| no_log: "{{ oc_no_log }}" | |
| - name: Configure project authorization | |
| hosts: all | |
| roles: | |
| - role: auth | |
| - name: Setup Jenkins and registry push credentials | |
| hosts: dev | |
| roles: | |
| - role: jenkins | |
| - role: pusher | |
| - name: Setup registry tokens | |
| hosts: | |
| - stage | |
| - prod | |
| roles: | |
| - role: puller |