Skip to content

Commit

Permalink
Added pre-config file to test autoscaling on OSP18
Browse files Browse the repository at this point in the history
  • Loading branch information
myadla committed May 15, 2024
1 parent 49f3446 commit 7b4bc42
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions playbooks/preconfig_osp18.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env ansible-playbook
---
# Pre-config steps to setup autoscaling for OSP18

- hosts: localhost
become: no
name: Pre-config steps for Autoscaling on OSP18

tasks:
- name: Install openstackclient dependencies
shell:
cmd: |
oc exec -ti openstackclient -- python3 -m ensurepip --upgrade
oc exec -ti openstackclient -- python3 -m pip install --upgrade aodhclient
oc exec -ti openstackclient -- python3 -m pip install python-observabilityclient
- name: Install Cluster Observability Operator(COO)
ansible.builtin.shell:
cmd: |
oc create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: cluster-observability-operator
namespace: openshift-operators
spec:
channel: development
installPlanApproval: Automatic
name: cluster-observability-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
EOF
changed_when: false
register: result
failed_when: result.rc >= 1

- name: Wait for the installation to succeed
pause:
minutes: 1

- name: Verify COO is installed successfully
ansible.builtin.command:
cmd: |
oc wait --for jsonpath="{.status.phase}"=Succeeded csv --namespace=openshift-operators -l operators.coreos.com/cluster-observability-operator.openshift-operators
register: result
changed_when: false
failed_when: '"condition met" not in result.stdout'

- name: Add content to a spec file in home dir
copy:
dest: $HOME/spec.yaml
content: |
spec:
customContainerImages:
aodhAPIImage: quay.io/podified-master-centos9/openstack-aodh-api:current-podified
aodhEvaluatorImage: quay.io/podified-master-centos9/openstack-aodh-evaluator:current-podified
aodhListenerImage: quay.io/podified-master-centos9/openstack-aodh-listener:current-podified
aodhNotifierImage: quay.io/podified-master-centos9/openstack-aodh-notifier:current-podified
heatAPIImage: quay.io/podified-master-centos9/openstack-heat-api:current-podified
heatCfnapiImage: quay.io/podified-master-centos9/openstack-heat-api-cfn:current-podified
heatEngineImage: quay.io/podified-master-centos9/openstack-heat-engine:current-podified
- name: Update the openstackversions CR to run master images for aodh and heat
ansible.builtin.shell:
cmd: |
oc patch openstackversions openstack-galera-network-isolation --type merge --patch-file $HOME/spec.yaml
register: result

...

1 comment on commit 7b4bc42

@myadla
Copy link
Collaborator Author

@myadla myadla commented on 7b4bc42 May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the required changes

Please sign in to comment.