donal
2018-04-17 c9eb0a1133ed9baf1bfa29c92d875a08b60756c8
UPDATE - new playbook layout based on the discussions with Global team
1 files deleted
3 files added
3 files modified
62 ■■■■ changed files
README.md 12 ●●●●● patch | view | raw | blame | history
apply.yml 10 ●●●●● patch | view | raw | blame | history
inventory/group_vars/all.yml 10 ●●●●● patch | view | raw | blame | history
inventory/group_vars/ci-cd-tooling.yml 5 ●●●●● patch | view | raw | blame | history
inventory/group_vars/projects-and-policies.yml 11 ●●●●● patch | view | raw | blame | history
inventory/hosts 10 ●●●● patch | view | raw | blame | history
params/project-requests-ci-cd 4 ●●●● patch | view | raw | blame | history
README.md
@@ -10,9 +10,13 @@
```bash
ansible-galaxy install -r requirements.yml --roles-path=roles
```
1. Run the play book using
1. Run the play book using this to create projects and roles
```bash
ansible-playbook roles/openshift-applier/playbooks/openshift-cluster-seed.yml -i inventory/
ansible-playbook apply.yml -i inventory/ -e target=bootstrap
```
1. Run the play book using this to create projects and roles
```bash
ansible-playbook apply.yml -i inventory/ -e target=tools
```
## Running a Subset of the Inventory
@@ -21,7 +25,7 @@
2. The only required tag to deploy objects within the inventory is **projects**, all other tags are *optional*
2. Here is an example that runs the tags that provision projects, ci, and jenkins objects:
```bash
ansible-playbook roles/openshift-applier/playbooks/openshift-cluster-seed.yml \
ansible-playbook apply.yml -e target=tools \
     -i inventory/ \
     -e="filter_tags=jenkins,ci,projects"
     -e "filter_tags=jenkins,ci,projects"
```
apply.yml
New file
@@ -0,0 +1,10 @@
---
- name: Deploy {{ target }}
  hosts: "{{ target }}"
  vars:
    ci_cd_namespace: <YOUR_NAME>-ci-cd
    dev_namespace: <YOUR_NAME>-dev
    test_namespace: <YOUR_NAME>-test
  tasks:
    - include_role:
        name: openshift-applier/roles/openshift-applier
inventory/group_vars/all.yml
File was deleted
inventory/group_vars/ci-cd-tooling.yml
New file
@@ -0,0 +1,5 @@
---
ansible_connection: local
openshift_cluster_content:
- object: ci-cd-tooling
  content:
inventory/group_vars/projects-and-policies.yml
New file
@@ -0,0 +1,11 @@
---
ansible_connection: local
openshift_cluster_content:
- object: projectrequest
  content:
  - name: {{ ci_cd_namespace }}
    template: "{{ playbook_dir }}/templates/project-requests.yml"
    template_action: create
    params: "{{ playbook_dir }}/params/project-requests-ci-cd"
    tags:
    - projects
inventory/hosts
@@ -1,2 +1,8 @@
[seed-hosts]
localhost ansible_connection=local
#[seed-hosts]
#localhost ansible_connection=local
[bootstrap]
projects-and-policies
[tools]
ci-cd-tooling
params/project-requests-ci-cd
@@ -1,2 +1,2 @@
NAMESPACE=<your name or initials>-ci-cd
NAMESPACE_DISPLAY_NAME=<your name or initials> Labs CI/CD
NAMESPACE=<YOUR_NAME>-ci-cd
NAMESPACE_DISPLAY_NAME=<YOUR_NAME> Labs CI/CD