Giter VIP home page Giter VIP logo

aap-ocpvirt-provisioning's Introduction

aap-ocpvirt-provisioning

It is recommended that you fork this repo and experiment with your own changes.

This repository contains automation for OCP, AAP, and OCP Virtualization provisioning. All playbooks are not needed to start provisioning, they are only included for readers that are potentially unfamilar with parts of the platform. The Openshift Virtualization inventories and playbooks can easily be integrated into a pre-existing AAP Project and Inventory in your instance without running the configure-aap playbook.

Prerequisites

An Openshift cluster running:

  • Openshift Virtualization Operator
  • Ansible Automation Platform Operator

It is assumed in this exercise that AAP and the Openshift Virtualization VMs all use the internal cluster network. That said, the steps should be similar if you are utilizing an external AAP and use Multus on the OCP cluster, provided you update the inventory plugin to query for the external network interfaces on the VMs.

Install Ansible dependencies

#TODO, show example ansible.cfg

Create openshift serviceaccounts and obtain tokens

cd openshift-serviceaccount-manifests
vim kustomization.yaml # Set namespace if required
oc apply -k .
oc create token virtualmachine-deployer -n <namespace> --duration=$((365*24))h
oc create token virtualmachine-reader -n <namespace> --duration=$((365*24))h

Create aap_vars.yml

In production, it is recommended to use a service account or token for configuring AAP as code

cp aap_vars.yml.example aap_vars.yml
vim aap_vars.yml

If you forked this repo, update the git_repo field to your fork

---
ocp_api: https://api.openshift.cluster:6443
inventory_sa_token: "changeme"
provisioner_sa_token: "changeme"
git_repo: https://github.com/David-Igou/aap-ocpvirt-provisioning.git
aap_organization: igou
ansible_user: cloud-user
ansible_user_private_key: |-
  -----BEGIN OPENSSH PRIVATE KEY-----
  -----END OPENSSH PRIVATE KEY-----
ansible_user_public_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPs4Ix5OQSAQnC/TLjxVGyzX+1ClHpWE2+6sT6ufVGR"
controller_hostname: https://aap.apps.openshift.cluster
controller_username: cac-user
controller_password: "foobar"

Optional: Set the scope of Openshift Virtualization Inventory

If you are working in a multi-tenant environment, you might want to update the inventory plugin to only discover VirtualMachines from certain namespaces, for example:

---
plugin: redhat.openshift_virtualization.kubevirt
connections:
  - namespaces:
      - igou

Configure AAP

To configure your AAP instance, create an SCM Project using your forked repository, and then create supporting objects

Ansible

ansible-galaxy install -r requirements.yml
ansible-playbook playbooks/configure-aap.yml -i inventory

Ansible-Navigator

If you have an execution environment containing the dependencies, you can use it in Ansible Navigator by running:

ansible-navigator run playbooks/aap/configure-aap.yml -e "@aap_vars.yml" -i inventory/

When your Inventory and SCM source are configured,

aap-ocpvirt-provisioning's People

Contributors

david-igou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.