joelbirchler
2020-02-28 409b6fd8f07eafa0b589cf3fa5532274a710d4fe
WIP changes localhost to specific internal domain names for gitlab and tower
2 files modified
30 ■■■■ changed files
ansible/roles/agnosticd-workload/tasks/gitlab.yml 10 ●●●● patch | view | raw | blame | history
ansible/roles/agnosticd-workload/tasks/tower.yml 20 ●●●● patch | view | raw | blame | history
ansible/roles/agnosticd-workload/tasks/gitlab.yml
@@ -43,7 +43,7 @@
- name: Retrieve access token
  uri:
    url: "https://localhost/oauth/token"
    url: "https://gitlab.{{zone_internal_dns}}/oauth/token"
    method: POST
    validate_certs: no
    status_code: 200
@@ -60,7 +60,7 @@
- name: Retrieve local user information via API
  uri:
    url: https://localhost/api/v4/users?username={{ user_prefix }}
    url: https://gitlab.{{zone_internal_dns}}/api/v4/users?username={{ user_prefix }}
    method: GET
    validate_certs: no
    status_code:
@@ -73,7 +73,7 @@
- name: Create projects via API
  uri:
    url: https://localhost/api/v4/projects/user/{{ gitlab_local_users.json[0].id }}
    url: https://gitlab.{{zone_internal_dns}}/api/v4/projects/user/{{ gitlab_local_users.json[0].id }}
    method: POST
    validate_certs: no
    status_code:
@@ -110,7 +110,7 @@
- name: Clone repositories
  git:
    repo: https://{{ user_prefix | urlencode }}:{{ windows_password | urlencode }}@localhost/student/{{ item }}.git
    repo: https://{{ user_prefix | urlencode }}:{{ windows_password | urlencode }}@gitlab.{{zone_internal_dns}}/student/{{ item }}.git
    dest: "/tmp/{{ item }}/"
    clone: yes
  with_items: "{{ repos_name.stdout_lines }}"
@@ -139,7 +139,7 @@
- name: Load files into repositories
  shell: |
    git init
    git remote add origin https://{{ user_prefix | urlencode }}:{{ windows_password | urlencode }}@localhost/student/{{ item }}.git
    git remote add origin https://{{ user_prefix | urlencode }}:{{ windows_password | urlencode }}@gitlab.{{zone_internal_dns}}/student/{{ item }}.git
    git add .
    git commit -m 'Establish initial {{ item }} repository'
    git push -u origin HEAD:master
ansible/roles/agnosticd-workload/tasks/tower.yml
@@ -41,7 +41,7 @@
- name: Retrieve default organization ID
  uri:
    url:  "https://localhost/api/v2/organizations/?name=Default"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/organizations/?name=Default"
    method: GET
    user: admin
    password: "{{ tower_admin_password }}"
@@ -55,7 +55,7 @@
- name: Retrieve default inventory ID
  uri:
    url: "https://localhost/api/v2/inventories/?name=Default+inventory"
    url: "https://tower.{{zone_internal_dns}}/api/v2/inventories/?name=Default+inventory"
    method: GET
    user: admin
    password: "{{ tower_admin_password }}"
@@ -69,7 +69,7 @@
- name: Create GitLab credentials
  uri:
    url:  "https://localhost/api/v2/credentials/"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/credentials/"
    method: POST
    user: admin
    password: "{{ tower_admin_password }}"
@@ -86,7 +86,7 @@
- name: Retrieve credentials ID
  uri:
    url:  "https://localhost/api/v2/credentials/?name=GitLab"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/credentials/?name=GitLab"
    method: GET
    user: admin
    password: "{{ tower_admin_password }}"
@@ -100,7 +100,7 @@
- name: Create DevOps credentials
  uri:
    url:  "https://localhost/api/v2/credentials/"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/credentials/"
    method: POST
    user: admin
    password: "{{ tower_admin_password }}"
@@ -117,7 +117,7 @@
- name: Retrieve credentials ID
  uri:
    url:  "https://localhost/api/v2/credentials/?name=DevOps"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/credentials/?name=DevOps"
    method: GET
    user: admin
    password: "{{ tower_admin_password }}"
@@ -131,7 +131,7 @@
- name: Create Tower credentials
  uri:
    url:  "https://localhost/api/v2/credentials/"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/credentials/"
    method: POST
    user: admin
    password: "{{ tower_admin_password }}"
@@ -148,7 +148,7 @@
- name: Create Git projects
  uri:
    url:  "https://localhost/api/v2/projects/"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/projects/"
    method: POST
    user: admin
    password: "{{ tower_admin_password }}"
@@ -179,7 +179,7 @@
- name: Retrieve projects ID
  uri:
    url:  "https://localhost/api/v2/projects/?name={{ item }}+repository"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/projects/?name={{ item }}+repository"
    method: GET
    user: admin
    password: "{{ tower_admin_password }}"
@@ -194,7 +194,7 @@
- name: Create job templates
  uri:
    url:  "https://localhost/api/v2/job_templates/"
    url:  "https://tower.{{zone_internal_dns}}/api/v2/job_templates/"
    method: POST
    user: admin
    password: "{{ tower_admin_password }}"