-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #356 from ecordell/ansible
Ansible playbook
- Loading branch information
Showing
22 changed files
with
199 additions
and
8 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,3 @@ | ||
[submodule "deploy/aos-olm/openshift-ansible"] | ||
path = deploy/aos-olm/openshift-ansible | ||
url = https://github.com/openshift/openshift-ansible |
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,12 @@ | ||
FROM registry.centos.org/centos/centos:7 | ||
|
||
RUN yum update -y | ||
RUN yum install -y golang make | ||
|
||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
WORKDIR /go/src/github.com/operator-framework/operator-lifecycle-manager | ||
COPY . . | ||
|
||
RUN make build |
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
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
Submodule openshift-ansible
added at
ed37b6
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,4 @@ | ||
--- | ||
- import_playbook: private/config.yaml | ||
vars: | ||
operator_lifecycle_manager_install: true |
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,6 @@ | ||
--- | ||
- name: Operator Lifecycle Manager | ||
hosts: masters[0] | ||
tasks: | ||
- import_role: | ||
name: olm |
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 @@ | ||
../../../openshift-ansible/roles/lib_openshift |
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 @@ | ||
../../../openshift-ansible/roles/lib_utils |
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 @@ | ||
../../../../deploy/aos-olm/0.4.1 |
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,22 @@ | ||
rbacApiVersion: rbac.authorization.k8s.io | ||
namespace: operator-lifecycle-manager | ||
catalog_namespace: operator-lifecycle-manager | ||
alm: | ||
replicaCount: 1 | ||
image: | ||
ref: quay.io/coreos/olm@sha256:351f0c4973a88a4ea606721555829776429b0ecb53d5a2bfee6bce459d109e5b | ||
pullPolicy: IfNotPresent | ||
service: | ||
internalPort: 8080 | ||
|
||
catalog: | ||
replicaCount: 1 | ||
image: | ||
ref: quay.io/coreos/catalog@sha256:54571e25474a9a063a144922e7321203e5aa5e63d03f748682d559341359a916 | ||
pullPolicy: IfNotPresent | ||
service: | ||
internalPort: 8080 | ||
|
||
catalog_sources: | ||
- tectonic-ocs | ||
- upstream-components |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
--- | ||
operator_lifecycle_manager_remove: false | ||
operator_lifecycle_manager_install: true |
Empty file.
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,16 @@ | ||
--- | ||
galaxy_info: | ||
author: Evan Cordell | ||
description: Operator Lifecycle Manager | ||
company: Red Hat, Inc. | ||
license: Apache License, Version 2.0 | ||
min_ansible_version: 2.1 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- 7 | ||
categories: | ||
- cloud | ||
dependencies: | ||
- role: lib_utils | ||
- role: lib_openshift |
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,19 @@ | ||
--- | ||
|
||
- name: create operator-lifecycle-manager project | ||
oc_project: | ||
name: operator-lifecycle-manager | ||
state: present | ||
node_selector: | ||
- "" | ||
|
||
- name: Make temp directory for manifests | ||
command: mktemp -d /tmp/olm-ansible-XXXXXX | ||
register: mktemp | ||
changed_when: False | ||
|
||
- name: Copy manifests to temp directory | ||
copy: | ||
src: "{{ item }}" | ||
dest: "{{ mktemp.stdout }}" | ||
with_fileglob: files/*.yaml |
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,8 @@ | ||
--- | ||
# do any asserts here | ||
|
||
- include_tasks: install.yaml | ||
when: operator_lifecycle_manager_install | bool | ||
|
||
- include_tasks: remove.yaml | ||
when: operator_lifecycle_manager_remove | bool |
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,8 @@ | ||
--- | ||
|
||
- import_tasks: remove_components.yaml | ||
|
||
- name: remove openshift-ansible-service-broker project | ||
oc_project: | ||
name: openshift-ansible-service-broker | ||
state: absent |
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 @@ | ||
--- |
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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# requires yq to be installed https://github.com/mikefarah/yq | ||
|
||
if [[ ${#@} < 2 ]]; then | ||
echo "Usage: $0 manifests outfile" | ||
echo "* manifests: directory of k8s manifests" | ||
echo "* outfile: the ansible file to append" | ||
exit 1 | ||
fi | ||
|
||
manifests=$1 | ||
outfile=$2 | ||
|
||
for filename in $manifests/*.yaml; do | ||
kind=$(yq r "$filename" kind) | ||
name=$(yq r "$filename" metadata.name) | ||
cat <<EOF >> $outfile | ||
- name: Apply $name $kind manifest | ||
oc_obj: | ||
state: present | ||
kind: $kind | ||
name: $name | ||
namespace: operator-lifecycle-manager | ||
files: | ||
- "{{ mktemp.stdout }}/$(basename $filename)" | ||
EOF | ||
done |
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# requires yq to be installed https://github.com/mikefarah/yq | ||
|
||
if [[ ${#@} < 2 ]]; then | ||
echo "Usage: $0 manifests outfile" | ||
echo "* manifests: directory of k8s manifests" | ||
echo "* outfile: the ansible file to append" | ||
exit 1 | ||
fi | ||
|
||
manifests=$1 | ||
outfile=$2 | ||
|
||
for filename in $manifests/*.yaml; do | ||
kind=$(yq r "$filename" kind) | ||
name=$(yq r "$filename" metadata.name) | ||
cat <<EOF >> $outfile | ||
- name: Remove $name $kind manifest | ||
oc_obj: | ||
state: absent | ||
kind: $kind | ||
name: $name | ||
namespace: operator-lifecycle-manager | ||
EOF | ||
done |
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