Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
l3acon committed Aug 27, 2024
1 parent 552acdc commit 8090d42
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
simple_ah_name: single-user-ah
simple_ah_namespace: aap
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: Setup environment vars
block:
- name: Create Secret and Install AutomationHub
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', __definition) }}"
loop:
- admin_secret.yml.j2
- hub.yml.j2
loop_control:
loop_var: __definition

- name: Retrieve created hub route
kubernetes.core.k8s_info:
api_version: "route.openshift.io/v1"
kind: Route
name: hub
namespace: "{{ simple_ah_namespace }}"
register: r_ah_route
until: r_ah_route.resources[0].spec.host is defined
retries: 300
delay: 30

- name: Get automation_hub route hostname
ansible.builtin.set_fact:
automation_hub_hostname: "{{ r_ah_route.resources[0].spec.host }}"
automation_hub_admin_password: "{{ r_ah_secret.resources[0].data.password |string |b64decode }}"

- name: Display AH Instance URL
ansible.builtin.debug:
msg:
- "AH URL: https://{{ automation_hub_hostname }}"
- "AH Admin Login: admin"
- "AH Admin Password: <same as the Controller Admin password>"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
kind: Secret
apiVersion: v1
metadata:
name: {{ simple_ah_name }}-admin-password
namespace: {{ simple_ah_namespace }}
labels:
app.kubernetes.io/component: automationhub
app.kubernetes.io/managed-by: automationhub-operator
app.kubernetes.io/name: {{ ah_insatnce_project_app_name }}
app.kubernetes.io/operator-version: '2.4'
app.kubernetes.io/part-of: {{ ah_instance_project_app_name }}
data:
password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') | b64encode }}"
type: Opaque
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
apiVersion: automationhub.ansible.com/v1beta1
kind: AutomationHub
metadata:
name: {{ simple_ah_name }}
namespace: {{ simple_ah_namespace }}
spec:
nginx_proxy_send_timeout: 120s
gunicorn_content_workers: 2
gunicorn_api_workers: 2
route_tls_termination_mechanism: Edge
ingress_type: Route
loadbalancer_port: 80
no_log: true
file_storage_size: 100Gi
image_pull_policy: IfNotPresent
nginx_proxy_read_timeout: 120s
gunicorn_timeout: 90
nginx_client_max_body_size: 10m
web:
replicas: 1
nginx_proxy_connect_timeout: 120s
haproxy_timeout: 180s
file_storage_access_mode: ReadWriteOnce
content:
log_level: INFO
replicas: 2
postgres_storage_requirements:
limits:
storage: 50Gi
requests:
storage: 8Gi
api:
log_level: INFO
replicas: 1
postgres_resource_requirements:
limits:
cpu: 1000m
memory: 8Gi
requests:
cpu: 500m
memory: 2Gi
redis:
log_level: INFO
replicas: 1
loadbalancer_protocol: http
resource_manager:
replicas: 1
worker:
replicas: 2
admin_password_secret: {{ simple_ah_name }}-admin-password
8 changes: 8 additions & 0 deletions openshift/hub/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Deploy simple Automation Hub instance
hosts: localhost
gather_facts: false
tasks:
- name: Include role
ansible.builtin.include_role:
name: demo.openshift.simple_ah
13 changes: 13 additions & 0 deletions openshift/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ controller_templates:
- "OpenShift Credential"
- "Controller Credential"

- name: OpenShift / Hub / Install Controller
job_type: run
inventory: "Demo Inventory"
project: "Ansible official demo project"
playbook: "openshift/hub/install.yml"
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
credentials:
- "OpenShift Credential"
- "Controller Credential"

- name: OpenShift / CNV / Install Operator
job_type: run
inventory: "Demo Inventory"
Expand Down

0 comments on commit 8090d42

Please sign in to comment.