-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ee334f
commit 79d77ed
Showing
2 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
- name: Deploy gitlab on OCP | ||
hosts: localhost | ||
gather_facts: false | ||
|
||
tasks: | ||
- name: create cert-manager-operator namespace | ||
redhat.openshift.k8s: | ||
name: cert-manager-operator | ||
api_version: v1 | ||
kind: Namespace | ||
state: present | ||
|
||
- name: create OperatorGroup object for cert-manager-operator | ||
redhat.openshift.k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
name: cert-manager-operator-operatorgroup | ||
namespace: cert-manager-operator | ||
spec: | ||
targetNamespaces: | ||
- cert-manager-operator | ||
|
||
- name: create cert-manager-operator subscription | ||
redhat.openshift.k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
labels: | ||
operators.coreos.com/openshift-cert-manager-operator.cert-manager-operator: '' | ||
name: openshift-cert-manager-operator | ||
namespace: cert-manager-operator | ||
spec: | ||
channel: stable-v1 | ||
installPlanApproval: Automatic | ||
name: openshift-cert-manager-operator | ||
source: redhat-operators | ||
sourceNamespace: openshift-marketplace | ||
|
||
- name: create gitlab-system namespace | ||
redhat.openshift.k8s: | ||
name: gitlab-system | ||
api_version: v1 | ||
kind: Namespace | ||
state: present | ||
|
||
- name: create OperatorGroup object for gitlab-operator-kubernetes | ||
redhat.openshift.k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
name: gitlab-operator-kubernetes-operatorgroup | ||
namespace: gitlab-system | ||
spec: | ||
targetNamespaces: | ||
- gitlab-system | ||
|
||
- name: create gitlab subscription | ||
redhat.openshift.k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
labels: | ||
operators.coreos.com/gitlab-operator-kubernetes.gitlab-system: '' | ||
name: gitlab-operator-kubernetes | ||
namespace: gitlab-system | ||
spec: | ||
channel: stable | ||
installPlanApproval: Automatic | ||
name: gitlab-operator-kubernetes | ||
source: community-operators | ||
sourceNamespace: openshift-marketplace | ||
|
||
- name: wait for gitlab operator to install | ||
k8s_info: | ||
api_version: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
name: gitlabs.apps.gitlab.com | ||
register: crd_gitlab | ||
until: crd_gitlab.resources | list | length == 1 | ||
retries: 10 | ||
delay: 30 | ||
|
||
- name: Wait until gitlab-operator is up | ||
Check warning on line 93 in openshift/gitlab.yml GitHub Actions / Ansible Lintjinja[spacing]
|
||
k8s_info: | ||
api_version: v1 | ||
kind: Deployment | ||
name: gitlab-controller-manager | ||
namespace: gitlab-system | ||
register: pod_list | ||
until: pod_list|json_query('resources[*].status.readyReplicas')|unique >= [1] | ||
retries: 10 | ||
delay: 30 | ||
|
||
- name: Deploy a GitLab instance | ||
redhat.openshift.k8s: | ||
state: present | ||
definition: | ||
apiVersion: apps.gitlab.com/v1beta1 | ||
kind: GitLab | ||
metadata: | ||
name: gitlab | ||
namespace: gitlab-system | ||
spec: | ||
chart: | ||
version: "6.11.0" | ||
values: | ||
nginx-ingress: | ||
enabled: false | ||
certmanager: | ||
install: false | ||
global: | ||
hosts: | ||
domain: "{{ cluster_domain }}" # apps.cluster-9xrlv.9xrlv.sandbox644.opentlc.com | ||
ingress: | ||
class: none | ||
configureCertmanager: true | ||
annotations: | ||
route.openshift.io/termination: "edge" | ||
certmanager-issuer: | ||
email: "{{ cert_email | default('[email protected]') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters