-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
7 changed files
with
153 additions
and
1 deletion.
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,28 @@ | ||
FROM ansibleplaybookbundle/apb-base | ||
|
||
LABEL "com.redhat.apb.spec"=\ | ||
"dmVyc2lvbjogMS4wCm5hbWU6IHZuYy1kZXNrdG9wLWFwYgpkZXNjcmlwdGlvbjogVGhpcyBpcyBh\ | ||
IHNhbXBsZSBhcHBsaWNhdGlvbiBnZW5lcmF0ZWQgYnkgYXBiIGluaXQKYmluZGFibGU6IEZhbHNl\ | ||
CmFzeW5jOiBvcHRpb25hbAptZXRhZGF0YToKICBkaXNwbGF5TmFtZTogIlZOQyBEZXNrdG9wIChB\ | ||
UEIpIgogIGRlcGVuZGVuY2llczoKICAtIGRvY2tlci5pby9hbnNpYmxlcGxheWJvb2tidW5kbGUv\ | ||
dm5jLWRlc2t0b3A6ZjI4CiAgLSBkb2NrZXIuaW8vYW5zaWJsZXBsYXlib29rYnVuZGxlL3ZuYy1k\ | ||
ZXNrdG9wOmYyNwpwbGFuczoKICAtIG5hbWU6IGYyOAogICAgZGVzY3JpcHRpb246IFJ1biBhIGRl\ | ||
c2t0b3Agb2YgeW91ciBjaG9pY2Ugb24gRmVkb3JhIDI4CiAgICBmcmVlOiBUcnVlCiAgICBtZXRh\ | ||
ZGF0YToge30KICAgIHBhcmFtZXRlcnM6CiAgICAtIG5hbWU6IHZuY3Bhc3MKICAgICAgdGl0bGU6\ | ||
IFZOQyBQYXNzd29yZAogICAgICB0eXBlOiBzdHJpbmcKICAgICAgcmVxdWlyZWQ6IHRydWUKICAg\ | ||
IC0gbmFtZTogZGUKICAgICAgdGl0bGU6IERlc2t0b3AgRW52aXJvbm1lbnQKICAgICAgdHlwZTog\ | ||
ZW51bQogICAgICBlbnVtOiBbJ0Npbm5hbW9uJywgJ2Z2d20nLCAnaTMnLCAnS0RFJywgJ0xYREUn\ | ||
LCAnTFhRdCcsICdNQVRFJywgJ1N1Z2FyJywgJ3R3bScsICdYZmNlJ10KICAgICAgZGVmYXVsdDog\ | ||
J1hmY2UnCiAgLSBuYW1lOiBmMjcKICAgIGRlc2NyaXB0aW9uOiBSdW4gYSBEZXNrdG9wIG9mIHlv\ | ||
dXIgY2hvaWNlIG9uIEZlZG9yYSAyNyAKICAgIGZyZWU6IFRydWUKICAgIG1ldGFkYXRhOiB7fQog\ | ||
ICAgcGFyYW1ldGVyczogCiAgICAtIG5hbWU6IHZuY3Bhc3MKICAgICAgdGl0bGU6IFZOQyBQYXNz\ | ||
d29yZAogICAgICB0eXBlOiBzdHJpbmcKICAgICAgcmVxdWlyZWQ6IHRydWUKICAgIC0gbmFtZTog\ | ||
ZGUKICAgICAgdGl0bGU6IERlc2t0b3AgRW52aXJvbm1lbnQKICAgICAgdHlwZTogZW51bQogICAg\ | ||
ICBlbnVtOiBbJ0Npbm5hbW9uJywgJ2Z2d20nLCAnaTMnLCAnS0RFJywgJ0xYREUnLCAnTFhRdCcs\ | ||
ICdNQVRFJywgJ1N1Z2FyJywgJ3R3bScsICdYZmNlJ10KICAgICAgZGVmYXVsdDogJ1hmY2UnCgo=" | ||
|
||
|
||
COPY playbooks /opt/apb/actions | ||
COPY roles /opt/ansible/roles | ||
RUN chmod -R g=u /opt/{ansible,apb} | ||
USER apb |
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,20 @@ | ||
DOCKERHOST = docker.io | ||
DOCKERORG = vnc-desktop-apb | ||
IMAGENAME = vnc-desktop | ||
TAG = latest | ||
USER=$(shell id -u) | ||
PWD=$(shell pwd) | ||
build_and_push: apb_build docker_push apb_push | ||
|
||
.PHONY: apb_build | ||
apb_build: | ||
docker run --rm --privileged -v $(PWD):/mnt:z -v $(HOME)/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $(USER) docker.io/ansibleplaybookbundle/apb-tools:latest prepare | ||
docker build -t $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) . | ||
|
||
.PHONY: docker_push | ||
docker_push: | ||
docker push $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) | ||
|
||
.PHONY: apb_push | ||
apb_push: | ||
docker run --rm --privileged -v $(PWD):/mnt:z -v $(HOME)/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $(USER) docker.io/ansibleplaybookbundle/apb-tools:latest push |
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,40 @@ | ||
version: 1.0 | ||
name: vnc-desktop-apb | ||
description: This is a sample application generated by apb init | ||
bindable: False | ||
async: optional | ||
metadata: | ||
displayName: "VNC Desktop (APB)" | ||
dependencies: | ||
- docker.io/ansibleplaybookbundle/vnc-desktop:f28 | ||
- docker.io/ansibleplaybookbundle/vnc-desktop:f27 | ||
plans: | ||
- name: f28 | ||
description: Run a desktop of your choice on Fedora 28 | ||
free: True | ||
metadata: {} | ||
parameters: | ||
- name: vncpass | ||
title: VNC Password | ||
type: string | ||
required: true | ||
- name: de | ||
title: Desktop Environment | ||
type: enum | ||
enum: ['Cinnamon', 'fvwm', 'i3', 'KDE', 'LXDE', 'LXQt', 'MATE', 'Sugar', 'twm', 'Xfce'] | ||
default: 'Xfce' | ||
- name: f27 | ||
description: Run a Desktop of your choice on Fedora 27 | ||
free: True | ||
metadata: {} | ||
parameters: | ||
- name: vncpass | ||
title: VNC Password | ||
type: string | ||
required: true | ||
- name: de | ||
title: Desktop Environment | ||
type: enum | ||
enum: ['Cinnamon', 'fvwm', 'i3', 'KDE', 'LXDE', 'LXQt', 'MATE', 'Sugar', 'twm', 'Xfce'] | ||
default: 'Xfce' | ||
|
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 @@ | ||
- name: vnc-desktop-apb playbook to deprovision the application | ||
hosts: localhost | ||
vars: | ||
state: absent | ||
gather_facts: false | ||
connection: local | ||
roles: | ||
- role: ansible.kubernetes-modules | ||
install_python_requirements: no | ||
- role: ansibleplaybookbundle.asb-modules | ||
- role: vnc-desktop-apb | ||
playbook_debug: false |
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 @@ | ||
- name: vnc-desktop-apb playbook to provision the application | ||
hosts: localhost | ||
vars: | ||
state: present | ||
gather_facts: false | ||
connection: local | ||
roles: | ||
- role: ansible.kubernetes-modules | ||
install_python_requirements: no | ||
- role: ansibleplaybookbundle.asb-modules | ||
- role: vnc-desktop-apb | ||
playbook_debug: false |
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,41 @@ | ||
- name: process deployment config | ||
openshift_v1_deployment_config: | ||
name: vnc-desktop | ||
state: '{{ state }}' | ||
namespace: '{{ namespace }}' | ||
labels: | ||
app: vnc-desktop | ||
service: vnc-desktop | ||
replicas: 1 | ||
selector: | ||
app: vnc-desktop | ||
service: vnc-desktop | ||
spec_template_metadata_labels: | ||
app: vnc-desktop | ||
service: vnc-desktop | ||
containers: | ||
- env: | ||
- name: VNCPASS | ||
value: "{{ vncpass }}" | ||
- name: DE | ||
value: "{{ de }}" | ||
image: docker.io/ansibleplaybookbundle/vnc-desktop:{{ _apb_plan_id }} | ||
name: vnc-desktop | ||
ports: | ||
- container_port: 5901 | ||
protocol: TCP | ||
|
||
- name: process vnc-desktop service | ||
k8s_v1_service: | ||
name: vnc-desktop | ||
namespace: '{{ namespace }}' | ||
labels: | ||
app: vnc-desktop | ||
service: vnc-desktop | ||
selector: | ||
app: vnc-desktop | ||
service: vnc-desktop | ||
ports: | ||
- name: vnc | ||
port: 5901 | ||
target_port: 5901 |